DATAREST-1256 - Upgraded to Spring HATEOAS 0.25.0.BUILD-SNAPSHOT.

Adapted RepositoryRestMvcConfiguration to now create a shared fallback ObjectMapper and avoid to register it as Spring Bean. Adapted test cases that previously were relying on such a bean being present.

Adapted test cases to verify on the correct ALPS document structure (see spring-projects/spring-hateoas#665).
This commit is contained in:
Oliver Gierke
2018-06-20 20:01:40 +02:00
parent 06f775abd0
commit 954416a2b9
8 changed files with 89 additions and 49 deletions

View File

@@ -25,7 +25,6 @@ import java.util.Collections;
import org.junit.Test;
import org.mockito.internal.stubbing.answers.ReturnsArgumentAt;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.mapping.context.PersistentEntities;
import org.springframework.data.rest.core.support.DefaultSelfLinkProvider;
import org.springframework.data.rest.core.support.EntityLookup;
@@ -39,8 +38,6 @@ import org.springframework.hateoas.EntityLinks;
import org.springframework.hateoas.Links;
import org.springframework.test.context.ContextConfiguration;
import com.fasterxml.jackson.databind.ObjectMapper;
/**
* Integration tests for {@link PersistentEntityResourceAssembler}.
*
@@ -51,7 +48,6 @@ public class PersistentEntityResourceAssemblerIntegrationTests extends AbstractC
@Autowired PersistentEntities entities;
@Autowired EntityLinks entityLinks;
@Autowired @Qualifier("objectMapper") ObjectMapper objectMapper;
@Autowired Associations associations;
@Test // DATAREST-609

View File

@@ -66,9 +66,10 @@ public class PersistentEntityToJsonSchemaConverterUnitTests {
@Autowired @Qualifier("resourceDescriptionMessageSourceAccessor") MessageSourceAccessor accessor;
@Autowired RepositoryRestConfiguration configuration;
@Autowired PersistentEntities entities;
@Autowired @Qualifier("objectMapper") ObjectMapper objectMapper;
@Autowired Associations associations;
ObjectMapper objectMapper = new ObjectMapper();
@Configuration
@Import(RepositoryRestMvcConfiguration.class)
static class TestConfiguration extends RepositoryRestConfigurerAdapter {