From 43e2df105c70608738c082a1cdb3ed2557a5a3c6 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 10 Jul 2018 15:57:09 +0100 Subject: [PATCH] Align with latest changes in Spring Data REST --- ...positoryRestMvcAutoConfigurationTests.java | 25 +++---------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/rest/RepositoryRestMvcAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/rest/RepositoryRestMvcAutoConfigurationTests.java index c552b8cad5..1fffb9bd80 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/rest/RepositoryRestMvcAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/rest/RepositoryRestMvcAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ package org.springframework.boot.autoconfigure.data.rest; import java.net.URI; import java.util.Date; -import java.util.Map; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @@ -40,7 +39,7 @@ import org.springframework.context.annotation.Import; import org.springframework.data.rest.core.config.RepositoryRestConfiguration; import org.springframework.data.rest.core.mapping.RepositoryDetectionStrategy.RepositoryDetectionStrategies; import org.springframework.data.rest.webmvc.BaseUri; -import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurerAdapter; +import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer; import org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration; import org.springframework.http.MediaType; import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; @@ -146,24 +145,6 @@ public class RepositoryRestMvcAutoConfigurationTests { assertThat(bean.getBaseUri()).isEqualTo(URI.create("")); } - @Test - public void objectMappersAreConfiguredUsingObjectMapperBuilder() - throws JsonProcessingException { - load(TestConfigurationWithObjectMapperBuilder.class); - - assertThatDateIsFormattedCorrectly("halObjectMapper"); - assertThatDateIsFormattedCorrectly("objectMapper"); - } - - @Test - public void primaryObjectMapperIsAvailable() { - load(TestConfiguration.class); - Map objectMappers = this.context - .getBeansOfType(ObjectMapper.class); - assertThat(objectMappers.size()).isGreaterThan(1); - this.context.getBean(ObjectMapper.class); - } - public void assertThatDateIsFormattedCorrectly(String beanName) throws JsonProcessingException { ObjectMapper objectMapper = this.context.getBean(beanName, ObjectMapper.class); @@ -221,7 +202,7 @@ public class RepositoryRestMvcAutoConfigurationTests { } - static class TestRepositoryRestConfigurer extends RepositoryRestConfigurerAdapter { + static class TestRepositoryRestConfigurer implements RepositoryRestConfigurer { @Override public void configureRepositoryRestConfiguration(