DATAREST-1076 - Expose constructor that takes RelProvider of RepositoryResourceMappings.
We now expose the constructor that takes a RelProvider in RepositoryResourceMappings so that clients can tweak the default relation names. Changed the order of constructor parameters of (previously) non-public constructors for consistency. The RelProvider to be used with the mappings can now be configured via RepositoryRestConfiguration and defaults to the EvoInflector based one.
This commit is contained in:
@@ -131,4 +131,9 @@ public class RepositoryRestConfigurationUnitTests {
|
||||
CorsConfiguration corsConfiguration = corsConfigurations.get("/hello");
|
||||
assertThat(corsConfiguration.getMaxAge()).isEqualTo(1234L);
|
||||
}
|
||||
|
||||
@Test // DATAREST-1076
|
||||
public void rejectsNullRelProvider() {
|
||||
assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> configuration.setRelProvider(null));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ public class RepositoryResourceMappingsIntegrationTests {
|
||||
|
||||
Repositories repositories = new Repositories(factory);
|
||||
this.mappings = new RepositoryResourceMappings(repositories, new PersistentEntities(Arrays.asList(mappingContext)),
|
||||
new EvoInflectorRelProvider(), RepositoryDetectionStrategies.DEFAULT);
|
||||
RepositoryDetectionStrategies.DEFAULT, new EvoInflectorRelProvider());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user