DATAREST-1397 - Polishing.

Removed the redeclaration of hasCorsConfigurationSource(…) in RepositoryRestHandlerMapping as it already inherits the one from BasePathAwareRestHandlerMapping.

Removed @Override on BasePathAwareRestHandlerMapping.hasCorsConfigurationSource(…) as we need to compile against Spring 5.1, which doesn't expose the method. Downgrades from Spring HATEOAS 1.0 API usage in tests.
This commit is contained in:
Oliver Drotbohm
2019-06-21 15:22:27 +02:00
parent 4e586495f4
commit 37b25008b0
3 changed files with 5 additions and 14 deletions

View File

@@ -23,7 +23,6 @@ import org.springframework.context.annotation.Bean;
import org.springframework.data.rest.tests.AbstractWebIntegrationTests;
import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer;
import org.springframework.hateoas.Link;
import org.springframework.hateoas.LinkRelation;
import org.springframework.http.HttpHeaders;
import org.springframework.test.context.ContextConfiguration;
@@ -50,7 +49,7 @@ public class LocalConfigCorsIntegrationTests extends AbstractWebIntegrationTests
@Test // DATAREST-1397
public void appliesRepositoryCorsConfiguration() throws Exception {
Link findItems = client.discoverUnique(LinkRelation.of("items"));
Link findItems = client.discoverUnique("items");
// Preflight request
mvc.perform(options(findItems.expand().getHref()).header(HttpHeaders.ORIGIN, "http://far.far.example")