-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
627135f
commit 8ff150d
Showing
6 changed files
with
88 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...org/geoserver/cloud/autoconfigure/web/extension/graticule/GraticuleAutoConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* (c) 2024 Open Source Geospatial Foundation - all rights reserved This code is licensed under the | ||
* GPL 2.0 license, available at the root application directory. | ||
*/ | ||
package org.geoserver.cloud.autoconfigure.web.extension.graticule; | ||
|
||
import org.geoserver.cloud.config.factory.FilteringXmlBeanDefinitionReader; | ||
import org.geotools.data.graticule.GraticuleDataStoreFactory; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.ImportResource; | ||
|
||
/** Auto configuration to enable the graticule customized store panel. */ | ||
@Configuration | ||
@ConditionalOnClass(GraticuleDataStoreFactory.class) | ||
@ImportResource( // | ||
reader = FilteringXmlBeanDefinitionReader.class, // | ||
locations = {"jar:gs-graticule-.*!/applicationContext.xml"}) | ||
public class GraticuleAutoConfiguration {} |
46 changes: 46 additions & 0 deletions
46
...geoserver/cloud/autoconfigure/web/extension/graticule/GraticuleAutoConfigurationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* (c) 2024 Open Source Geospatial Foundation - all rights reserved This code is licensed under the | ||
* GPL 2.0 license, available at the root application directory. | ||
*/ | ||
package org.geoserver.cloud.autoconfigure.web.extension.graticule; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import org.geoserver.web.data.resource.DataStorePanelInfo; | ||
import org.geoserver.web.data.store.graticule.GraticuleStoreEditPanel; | ||
import org.geotools.data.graticule.GraticuleDataStoreFactory; | ||
import org.junit.jupiter.api.Test; | ||
import org.springframework.boot.autoconfigure.AutoConfigurations; | ||
import org.springframework.boot.test.context.runner.ApplicationContextRunner; | ||
|
||
/** | ||
* Test suite for {@link GraticuleAutoConfiguration} | ||
* | ||
* @since 1.8 | ||
*/ | ||
class GraticuleAutoConfigurationTest { | ||
|
||
private final ApplicationContextRunner contextRunner = | ||
new ApplicationContextRunner() | ||
.withConfiguration(AutoConfigurations.of(GraticuleAutoConfiguration.class)); | ||
|
||
@Test | ||
void test_enabled() { | ||
|
||
contextRunner.run( | ||
context -> { | ||
assertThat(context) | ||
.hasBean("graticuleStorePanel") | ||
.getBean("graticuleStorePanel") | ||
.isInstanceOf(DataStorePanelInfo.class); | ||
|
||
assertThat(context.getBean("graticuleStorePanel", DataStorePanelInfo.class)) | ||
.hasFieldOrPropertyWithValue( | ||
"factoryClass", GraticuleDataStoreFactory.class); | ||
|
||
assertThat(context.getBean("graticuleStorePanel", DataStorePanelInfo.class)) | ||
.hasFieldOrPropertyWithValue( | ||
"componentClass", GraticuleStoreEditPanel.class); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters