Skip to content

Commit

Permalink
gwc - cleaning up late comments on PR529
Browse files Browse the repository at this point in the history
  • Loading branch information
pmauduit committed Oct 1, 2024
1 parent 4299702 commit eb44b08
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 120 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import com.google.gson.JsonParser;

import org.geoserver.catalog.GeoServerCatalogTestData;
import org.geoserver.gwc.controller.GwcUrlHandlerMapping;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -81,16 +80,6 @@ void testRESTPathExtensionContentNegotiation() {
testGetRequestContentType("/gwc/rest/layers.xml", APPLICATION_XML);
}

@Test
void testGwcUrlHandlerMappingArePresentInTheClasspath() {
assertThat(context.isTypeMatch("gwcDemoUrlHandlerMapping", GwcUrlHandlerMapping.class))
.as("expected a bean gwcDemoUrlHandlerMapping of type GwcUrlHandlerMapping")
.isTrue();
assertThat(context.isTypeMatch("gwcRestWebUrlHandlerMapping", GwcUrlHandlerMapping.class))
.as("expected a bean gwcRestWebUrlHandlerMapping of type GwcUrlHandlerMapping")
.isTrue();
}

@Test
void testGeneralGwcHome() {
ResponseEntity<String> response = testGetRequestContentType("/gwc/home", TEXT_HTML);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
import org.geoserver.cloud.autoconfigure.gwc.ConditionalOnWebUIEnabled;
import org.geoserver.cloud.gwc.config.core.GeoWebCacheConfigurationProperties;
import org.geoserver.cloud.virtualservice.VirtualServiceVerifier;
import org.geoserver.gwc.controller.GwcUrlHandlerMapping;
import org.geoserver.ows.Dispatcher;
import org.geowebcache.GeoWebCacheDispatcher;
import org.geowebcache.rest.controller.ByteStreamController;
import org.gwc.web.rest.GeoWebCacheController;
Expand All @@ -33,10 +31,8 @@ public class GeoWebCacheUIAutoConfiguration {

@Bean
GeoWebCacheController gwcController(
Dispatcher geoserverDispatcher,
GeoWebCacheDispatcher geoWebCacheDispatcher,
VirtualServiceVerifier verifier) {
return new GeoWebCacheController(geoserverDispatcher, geoWebCacheDispatcher, verifier);
GeoWebCacheDispatcher geoWebCacheDispatcher, VirtualServiceVerifier verifier) {
return new GeoWebCacheController(geoWebCacheDispatcher, verifier);
}

/** ConditionalOnGeoWebCacheRestConfigEnabled} is disabled */
Expand All @@ -50,61 +46,4 @@ ByteStreamController byteStreamController() {
VirtualServiceVerifier virtualServiceVerifier(@Qualifier("rawCatalog") Catalog catalog) {
return new VirtualServiceVerifier(catalog);
}

/**
* GS's src/web/gwc/src/main/java/applicationContext.xml
* <!-- Used for workspace-based demo requests so the requests to GS stay workspace-based -->
* <bean id="gwcDemoUrlHandlerMapping"
* class="org.geoserver.gwc.controller.GwcUrlHandlerMapping"> <constructor-arg ref="catalog" />
* <constructor-arg value="/gwc/demo"/> <property name="alwaysUseFullPath" value="true" />
* <property name="order" value="10" /> </bean>
* <!-- Used for workspace-based web requests (i.e. for rest/web/openlayer/ol.js) -->
* <bean id="gwcRestWebUrlHandlerMapping"
* class="org.geoserver.gwc.controller.GwcUrlHandlerMapping"> <constructor-arg ref="catalog" />
* <constructor-arg type="java.lang.String" value="/gwc/rest/web"/> <property
* name="alwaysUseFullPath" value="true" /> <property name="order" value="10" /> </bean>
*/
@Bean
@Qualifier("gwcDemoUrlHandlerMapping")
GwcUrlHandlerMapping gwcDemoUrlHandlerMapping(@Qualifier("rawCatalog") Catalog catalog) {
GwcUrlHandlerMapping handler = new GwcUrlHandlerMapping(catalog, "/gwc/demo");
handler.setAlwaysUseFullPath(true);
handler.setOrder(10);

return handler;
}

/*
@Bean
WebMvcRegistrations gwcDemoUrlHandlerMappingRegistrations(
@Qualifier("gwcDemoUrlHandlerMapping") GwcUrlHandlerMapping handler) {
return new WebMvcRegistrations() {
@Override
public RequestMappingHandlerMapping getRequestMappingHandlerMapping() {
return handler;
}
};
}*/

@Bean
@Qualifier("gwcRestWebUrlHandlerMapping")
GwcUrlHandlerMapping gwcRestWebUrlHandlerMapping(@Qualifier("rawCatalog") Catalog catalog) {
GwcUrlHandlerMapping handler = new GwcUrlHandlerMapping(catalog, "/gwc/rest/web");
handler.setAlwaysUseFullPath(true);
handler.setOrder(10);

return handler;
}

/*
@Bean
WebMvcRegistrations gwcRestWebUrlHandlerMappingRegistrations(
@Qualifier("gwcRestWebUrlHandlerMapping") GwcUrlHandlerMapping handler) {
return new WebMvcRegistrations() {
@Override
public RequestMappingHandlerMapping getRequestMappingHandlerMapping() {
return handler;
}
};
}*/
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import org.geoserver.cloud.virtualservice.VirtualServiceVerifier;
import org.geoserver.gwc.dispatch.GeoServerGWCDispatcherController;
import org.geoserver.ows.Dispatcher;
import org.geowebcache.GeoWebCacheDispatcher;
import org.geowebcache.controller.GeoWebCacheDispatcherController;
import org.springframework.stereotype.Controller;
Expand All @@ -29,9 +28,6 @@
@Controller
@RequiredArgsConstructor
public class GeoWebCacheController {

private final @NonNull Dispatcher geoserverDispatcher;

private final @NonNull GeoWebCacheDispatcher geoWebCacheDispatcher;

private final @NonNull VirtualServiceVerifier virtualServiceVerifier;
Expand Down

0 comments on commit eb44b08

Please sign in to comment.