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: 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 $ cf push -p start.jar -p start.jar -n start

View File

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

View File

@@ -94,3 +94,10 @@ projects:
- name: Java - name: Java
value: java value: java
selected: true 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"' : ''}/> <input type="radio" name="language" value="${it.value}"${it.selected==true ? ' checked="true"' : ''}/>
${it.name} ${it.name}
</label><% } %> </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> <button type="submit" class="btn">Generate</button>
</form> </form>
</div> </div>

View File

@@ -53,6 +53,12 @@ class IntegrationTests {
assertTrue('Wrong body:\n' + body, body.contains('name="style" value="web"')) 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 @Test
void downloadStarter() { void downloadStarter() {
byte[] body = new TestRestTemplate().getForObject('http://localhost:' + port + 'starter.zip', byte[]) byte[] body = new TestRestTemplate().getForObject('http://localhost:' + port + 'starter.zip', byte[])