DATAREST-577 - Removed obsolete dependency to configuration from RepositoryResourceMappings.

This avoids a cyclic dependency between the configuration and the mappings that caused bootstrap issues.
This commit is contained in:
Oliver Gierke
2015-06-19 12:40:42 +02:00
parent e6f5d9bbd8
commit fcb55865bf
4 changed files with 8 additions and 15 deletions

View File

@@ -54,11 +54,10 @@ public class RepositoryResourceMappings implements ResourceMappings {
* Creates a new {@link RepositoryResourceMappings} using the given {@link RepositoryRestConfiguration} and
* {@link Repositories} .
*
* @param config
* @param repositories
* @param repositories must not be {@literal null}.
*/
public RepositoryResourceMappings(RepositoryRestConfiguration config, Repositories repositories) {
this(config, repositories, new EvoInflectorRelProvider());
public RepositoryResourceMappings(Repositories repositories) {
this(repositories, new EvoInflectorRelProvider());
}
/**
@@ -69,8 +68,7 @@ public class RepositoryResourceMappings implements ResourceMappings {
* @param repositories must not be {@literal null}.
* @param relProvider must not be {@literal null}.
*/
public RepositoryResourceMappings(RepositoryRestConfiguration config, Repositories repositories,
RelProvider relProvider) {
public RepositoryResourceMappings(Repositories repositories, RelProvider relProvider) {
Assert.notNull(repositories, "Repositories must not be null!");
Assert.notNull(relProvider, "RelProvider must not be null!");

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2014 the original author or authors.
* Copyright 2013-2015 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.
@@ -31,7 +31,6 @@ import org.springframework.data.mapping.PersistentEntity;
import org.springframework.data.mapping.PersistentProperty;
import org.springframework.data.repository.support.Repositories;
import org.springframework.data.rest.core.Path;
import org.springframework.data.rest.core.config.RepositoryRestConfiguration;
import org.springframework.data.rest.core.domain.jpa.Author;
import org.springframework.data.rest.core.domain.jpa.CreditCard;
import org.springframework.data.rest.core.domain.jpa.JpaRepositoryConfig;
@@ -59,7 +58,7 @@ public class ResourceMappingsIntegrationTests {
public void setUp() {
Repositories repositories = new Repositories(factory);
this.mappings = new RepositoryResourceMappings(new RepositoryRestConfiguration(), repositories);
this.mappings = new RepositoryResourceMappings(repositories);
}
@Test

View File

@@ -526,11 +526,7 @@ public class RepositoryRestMvcConfiguration extends HateoasAwareSpringDataWebCon
@Bean
public ResourceMappings resourceMappings() {
Repositories repositories = repositories();
RepositoryRestConfiguration config = config();
return new RepositoryResourceMappings(config, repositories);
return new RepositoryResourceMappings(repositories());
}
/**

View File

@@ -94,7 +94,7 @@ public class RepositoryTestsConfig {
@Bean
public Module persistentEntityModule() {
return new PersistentEntityJackson2Module(new RepositoryResourceMappings(config(), repositories()),
return new PersistentEntityJackson2Module(new RepositoryResourceMappings(repositories()),
persistentEntities(), config(), new UriToEntityConverter(persistentEntities(), defaultConversionService()));
}