Skip to content

Commit 1d3a8c8

Browse files
committed
wip
1 parent f3fd20d commit 1d3a8c8

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

tools/server-boot/src/main/java/org/eclipse/rdf4j/tools/serverboot/Rdf4jServerWorkbenchApplication.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.apache.catalina.Context;
2626
import org.eclipse.rdf4j.common.platform.Platform;
2727
import org.eclipse.rdf4j.common.platform.PlatformFactory;
28-
import org.eclipse.rdf4j.tools.serverboot.config.SolrAutoConfigurationDisabler;
2928
import org.eclipse.rdf4j.workbench.proxy.CacheFilter;
3029
import org.eclipse.rdf4j.workbench.proxy.CookieCacheControlFilter;
3130
import org.eclipse.rdf4j.workbench.proxy.RedirectFilter;
@@ -65,7 +64,6 @@ public static void main(String[] args) {
6564
ensureAppDataDirAccessible();
6665
SpringApplication application = new SpringApplication(Rdf4jServerWorkbenchApplication.class);
6766
SignalShutdownHandler signalShutdownHandler = SignalShutdownHandler.register("INT", "TERM");
68-
application.addInitializers(new SolrAutoConfigurationDisabler());
6967
ConfigurableApplicationContext context = application.run(args);
7068
signalShutdownHandler.attachContext(context);
7169
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2025 Eclipse RDF4J contributors.
3+
*
4+
* All rights reserved. This program and the accompanying materials
5+
* are made available under the terms of the Eclipse Distribution License v1.0
6+
* which accompanies this distribution, and is available at
7+
* http://www.eclipse.org/org/documents/edl-v10.php.
8+
*
9+
* SPDX-License-Identifier: BSD-3-Clause
10+
*******************************************************************************/
11+
// Some portions generated by Codex
12+
package org.eclipse.rdf4j.tools.serverboot.config;
13+
14+
import static org.assertj.core.api.Assertions.assertThatCode;
15+
16+
import java.util.Map;
17+
18+
import org.junit.jupiter.api.Test;
19+
import org.springframework.core.env.ConfigurableEnvironment;
20+
import org.springframework.core.env.MapPropertySource;
21+
import org.springframework.core.env.StandardEnvironment;
22+
23+
class SolrAutoConfigurationDisablerTest {
24+
25+
@Test
26+
void updateEnvironmentDoesNotThrowWhenPropertySourceAlreadyPresent() {
27+
ConfigurableEnvironment environment = new StandardEnvironment();
28+
environment.getPropertySources()
29+
.addFirst(new MapPropertySource("rdf4jSolrAutoConfiguration",
30+
Map.of("spring.autoconfigure.exclude", "com.example.ExistingAutoConfig")));
31+
32+
SolrAutoConfigurationDisabler disabler = new SolrAutoConfigurationDisabler();
33+
34+
assertThatCode(() -> disabler.postProcessEnvironment(environment, null)).doesNotThrowAnyException();
35+
}
36+
}

0 commit comments

Comments
 (0)