Skip to content

Commit

Permalink
When the app starts, accessing "/browse" does not work #2
Browse files Browse the repository at this point in the history
registered auto configuration of ui module
  • Loading branch information
Remo Meier committed Dec 27, 2017
1 parent d7ae3cf commit 4dff85c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@
* Disable with the property <code>crnk.ui.enabled = false</code>
*/
@Configuration

@ConditionalOnProperty(prefix = "crnk.ui", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnClass(UIModule.class)
@ConditionalOnMissingBean(UIModule.class)

@EnableConfigurationProperties({ CrnkUiProperties.class })
@Import({ CrnkConfigV3.class })
public class CrnkUIAutoConfiguration {
Expand Down
2 changes: 1 addition & 1 deletion crnk-spring/src/main/resources/META-INF/spring.factories
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
io.crnk.spring.boot.autoconfigure.CrnkJpaAutoConfiguration,\
io.crnk.spring.boot.autoconfigure.CrnkMetaAutoConfiguration,\
io.crnk.spring.boot.autoconfigure.CrnkOperationsAutoConfiguration,\
io.crnk.spring.boot.autoconfigure.CrnkSecurityAutoConfiguration,\
io.crnk.spring.boot.autoconfigure.CrnkUIAutoConfiguration,\
io.crnk.spring.boot.autoconfigure.CrnkSecurityAutoConfiguration,\
io.crnk.spring.boot.autoconfigure.CrnkSpringMvcAutoConfiguration,\
io.crnk.spring.boot.autoconfigure.CrnkSpringCloudSleuthAutoConfiguration,\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ public void testJpa() throws Exception {
assertThatJson(response.getBody()).node("data").isPresent();
}

@Test
public void testUiModuleRunning() throws Exception {
RestTemplate testRestTemplate = new RestTemplate();
ResponseEntity<String> response = testRestTemplate
.getForEntity("http://localhost:" + this.port + "/api/browse/index.html", String.class);
assertEquals(HttpStatus.OK, response.getStatusCode());
}


@Test
public void testTestCustomEndpoint() throws Exception {
RestTemplate testRestTemplate = new RestTemplate();
Expand Down

0 comments on commit 4dff85c

Please sign in to comment.