diff --git a/app.groovy b/app.groovy index 6bc97c0c..4bfae853 100644 --- a/app.groovy +++ b/app.groovy @@ -144,7 +144,7 @@ class MainController { resources.mkdirs() new File(resources, 'application.properties').write('') - if (isWebStyle(request.style)) { + if (request.style.any { isWebStyle(it) }) { new File(dir, 'src/main/resources/templates').mkdirs() new File(dir, 'src/main/resources/static').mkdirs() } @@ -212,7 +212,7 @@ class MainController { } private boolean isWebStyle(String style) { - return style.contains('web') || style.contains('thymeleaf') || style.contains('freemarker') || style.contains('velocity') || style.contains('groovy-template') + style.contains('web') || style.contains('thymeleaf') || style.contains('freemarker') || style.contains('velocity') || style.contains('groovy-template') } } diff --git a/test/integration.groovy b/test/integration.groovy index 024c8c4d..336df66a 100644 --- a/test/integration.groovy +++ b/test/integration.groovy @@ -52,6 +52,13 @@ class IntegrationTests { assertTrue(body.length>100) } + @Test + void installer() { + ResponseEntity response = new TestRestTemplate().getForEntity('http://localhost:' + port + 'install.sh', String) + assertEquals(HttpStatus.OK, response.getStatusCode()) + assertNotNull(response.body) + } + } // CLI compiled classes are not @ComponentScannable so we have to create