Add bootVersion to home page

This commit is contained in:
Dave Syer 2014-06-24 09:42:54 +01:00
parent 92f3e343b6
commit 76e7f3f15c
5 changed files with 25 additions and 1 deletions

View File

@ -59,5 +59,5 @@ before running `cf push`.
Alternatively you can jar up the app and make it executable in any environment. Care is needed with the includes and excludes:
$ spring jar --include '+templates/*.groovy,+spring/**' --exclude '-**/*.groovy,-**/*.jar,start.jar' start.jar app.groovy
$ spring jar --include '+spring/**' --exclude '-**/*.jar,start.jar' start.jar app.groovy
$ cf push -p start.jar -p start.jar -n start

View File

@ -269,6 +269,7 @@ class Projects {
List<Packaging> packagings
List<JavaVersion> javaVersions
List<Language> languages
List<BootVersion> bootVersions
static class Language {
String name
String value
@ -289,4 +290,8 @@ class Projects {
String value
boolean selected
}
static class BootVersion {
String value
boolean selected
}
}

View File

@ -94,3 +94,10 @@ projects:
- name: Java
value: java
selected: true
bootVersions:
- value: 1.1.2.BUILD-SNAPSHOT
selected: false
- value: 1.1.1.RELEASE
selected: true
- value: 1.0.2.RELEASE
selected: false

View File

@ -70,6 +70,12 @@
<input type="radio" name="language" value="${it.value}"${it.selected==true ? ' checked="true"' : ''}/>
${it.name}
</label><% } %>
<label>Spring Boot Version:</label>
<% bootVersions.each { %>
<label class="radio">
<input type="radio" name="bootVersion" value="${it.value}"${it.selected==true ? ' checked="true"' : ''}/>
${it.name}
</label><% } %>
<button type="submit" class="btn">Generate</button>
</form>
</div>

View File

@ -53,6 +53,12 @@ class IntegrationTests {
assertTrue('Wrong body:\n' + body, body.contains('name="style" value="web"'))
}
@Test
void homeHasBootVersion() {
String body = home()
assertTrue('Wrong body:\n' + body, body.contains('name="bootVersion" value="1'))
}
@Test
void downloadStarter() {
byte[] body = new TestRestTemplate().getForObject('http://localhost:' + port + 'starter.zip', byte[])