use of org.springframework.data.rest.webmvc.BaseUri in project spring-boot by spring-projects.
the class RepositoryRestMvcAutoConfigurationTests method testWithCustomBasePath.
@Test
public void testWithCustomBasePath() throws Exception {
load(TestConfiguration.class, "spring.data.rest.base-path:foo");
assertThat(this.context.getBean(RepositoryRestMvcConfiguration.class)).isNotNull();
RepositoryRestConfiguration bean = this.context.getBean(RepositoryRestConfiguration.class);
URI expectedUri = URI.create("/foo");
assertThat(bean.getBaseUri()).as("Custom basePath not set").isEqualTo(expectedUri);
BaseUri baseUri = this.context.getBean(BaseUri.class);
assertThat(expectedUri).as("Custom basePath has not been applied to BaseUri bean").isEqualTo(baseUri.getUri());
}
Aggregations