Polish contribution

Closes gh-173
This commit is contained in:
Stephane Nicoll
2016-01-05 14:48:32 +00:00
parent d1fb4ad2d6
commit 4ce9c412bb
4 changed files with 50 additions and 13 deletions

View File

@@ -83,15 +83,18 @@ via a plain HTTP call.
[[customize-form]] [[customize-form]]
== Customize form inputs == Customize form inputs
You can share or bookmark URL that will customize automatically form inputs with this kind of hashbang parameters: You can share or bookmark URLs that will automatically customize form inputs. For instance,
the following URL from the default instance uses `groovy` by default and set the name
to `Groovy Sample`:
[source,bash] [source,bash]
---- ----
https://start.spring.io/#!language=groovy&name=Groovy%20Sample https://start.spring.io/#!language=groovy&name=Groovy%20Sample
---- ----
`type`, `groupId`, `artifactId`, `name`, `description`, `packageName`, The following hashbang parameters are supported: `type`, `groupId`, `artifactId`, `name`,
`packaging`, `javaVersion` and `language` parameters are supported. `description`, `packageName`, `packaging`, `javaVersion` and `language`. Review the section
above for a description of each of them.
[[meta-data]] [[meta-data]]
== Service meta-data == Service meta-data

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2015 the original author or authors. * Copyright 2012-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -29,7 +29,7 @@ class ProjectAssert {
public static final DEFAULT_PACKAGE_NAME = 'com.example' public static final DEFAULT_PACKAGE_NAME = 'com.example'
private static final DEFAULT_APPLICATION_NAME = generateDefaultApplicationName() public static final DEFAULT_APPLICATION_NAME = 'DemoApplication'
final File dir final File dir
Boolean mavenProject Boolean mavenProject
@@ -159,8 +159,4 @@ class ProjectAssert {
new File(dir, localPath) new File(dir, localPath)
} }
private static generateDefaultApplicationName() {
'DemoApplication'
}
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2015 the original author or authors. * Copyright 2012-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -30,6 +30,7 @@ import org.openqa.selenium.interactions.Actions
import org.springframework.test.context.ActiveProfiles import org.springframework.test.context.ActiveProfiles
import static org.junit.Assert.assertEquals
import static org.junit.Assert.assertTrue import static org.junit.Assert.assertTrue
/** /**
@@ -310,8 +311,45 @@ class ProjectGenerationSmokeTests extends AbstractInitializrControllerIntegratio
} }
} }
@Test
void customizationShowsUpInDefaultView() {
toHome('/#!language=groovy&packageName=com.example.acme') {
assertEquals 'groovy', page.language.value()
assertEquals 'com.example.acme', page.packageName.value()
page.generateProject.click()
at HomePage
def projectAssert = zipProjectAssert(from('demo.zip'))
projectAssert.hasBaseDir('demo')
.isMavenProject()
.isGroovyProject('com.example.acme', ProjectAssert.DEFAULT_APPLICATION_NAME )
.hasStaticAndTemplatesResources(false)
.pomAssert().hasDependenciesCount(3)
.hasSpringBootStarterRootDependency().hasSpringBootStarterTest()
.hasDependency('org.codehaus.groovy', 'groovy')
}
}
@Test
void customizationsShowsUpWhenViewIsSwitched() {
toHome('/#!packaging=war&javaVersion=1.7') {
assertEquals 'war', page.packaging.value()
assertEquals '1.7', page.javaVersion.value()
page.advanced().click()
assertEquals 'war', page.packaging.value()
assertEquals '1.7', page.javaVersion.value()
page.simple().click()
assertEquals 'war', page.packaging.value()
assertEquals '1.7', page.javaVersion.value()
}
}
private Browser toHome(Closure script) { private Browser toHome(Closure script) {
browser.go("http://localhost:" + port + "/") toHome('/', script)
}
private Browser toHome(String uri, Closure script) {
browser.go("http://localhost:$port$uri")
browser.at HomePage browser.at HomePage
script.delegate = browser script.delegate = browser
script() script()

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2015 the original author or authors. * Copyright 2012-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -29,7 +29,7 @@ class HomePage extends Page {
static at = { title == 'Spring Initializr' } static at = { title == 'Spring Initializr' }
static content = { static content = {
advanced { $('.tofullversion a') } advanced { $('.tofullversion a') }
simple { $('tosimpleversion a') } simple { $('.tosimpleversion a') }
// Simple view // Simple view
groupId { $('form').groupId() } groupId { $('form').groupId() }