From 8187ced611a0fdf7d1ea832e5bb62ae0db187c06 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Tue, 29 Sep 2015 08:35:23 +0200 Subject: [PATCH] Polish template I like Spring Initializr (numerous references on twitter) and it feels odd to me to put the address of the web site on the web site itself since we want to push for custom deployments (that would have a different URL obviously). Also the "Quick add dependencies" can be simply named "Dependencies"; it is consistent with the project metadata section as well. Also, the template does not have any reference to 'install.sh' so any test relying on the presence of that link now fails. Replaced them with a different reference. See gh-145 --- initializr/src/main/resources/templates/home.html | 10 +++++----- .../web/MainControllerEnvIntegrationTests.groovy | 7 +++++-- .../web/MainControllerIntegrationTests.groovy | 3 --- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/initializr/src/main/resources/templates/home.html b/initializr/src/main/resources/templates/home.html index 241f0730..d1bddc9f 100644 --- a/initializr/src/main/resources/templates/home.html +++ b/initializr/src/main/resources/templates/home.html @@ -1,7 +1,7 @@ - start.spring.io + Spring Initializr @@ -14,9 +14,9 @@
-

start.spring.io

+

Spring Initializr

-

Generate your Spring Boot project in seconds!

+

Bootstrap your application now

-

Quick add dependencies

+

Dependencies

Add Spring Boot Starters and dependencies to your application

@@ -121,7 +121,7 @@

- Or check out the complete list of Dependencies. + Or check out the complete list of dependencies.

diff --git a/initializr/src/test/groovy/io/spring/initializr/web/MainControllerEnvIntegrationTests.groovy b/initializr/src/test/groovy/io/spring/initializr/web/MainControllerEnvIntegrationTests.groovy index d8ef7fdf..fa81421e 100644 --- a/initializr/src/test/groovy/io/spring/initializr/web/MainControllerEnvIntegrationTests.groovy +++ b/initializr/src/test/groovy/io/spring/initializr/web/MainControllerEnvIntegrationTests.groovy @@ -20,6 +20,7 @@ import org.junit.Test import org.springframework.http.HttpEntity import org.springframework.http.HttpStatus +import org.springframework.http.ResponseEntity import org.springframework.test.context.ActiveProfiles import static org.junit.Assert.* @@ -40,8 +41,10 @@ class MainControllerEnvIntegrationTests extends AbstractInitializrControllerInte @Test void doNotForceSsl() { - def body = htmlHome() - assertTrue "Force SSL should be disabled", body.contains("http://localhost:$port/install.sh") + ResponseEntity response = invokeHome('curl/1.2.4', "*/*") + String body = response.getBody() + assertTrue "Must not force https", body.contains("http://localhost:$port/") + assertFalse "Must not force https", body.contains('https://') } @Test diff --git a/initializr/src/test/groovy/io/spring/initializr/web/MainControllerIntegrationTests.groovy b/initializr/src/test/groovy/io/spring/initializr/web/MainControllerIntegrationTests.groovy index 5ce4431c..8b9cea73 100644 --- a/initializr/src/test/groovy/io/spring/initializr/web/MainControllerIntegrationTests.groovy +++ b/initializr/src/test/groovy/io/spring/initializr/web/MainControllerIntegrationTests.groovy @@ -34,7 +34,6 @@ import static org.hamcrest.CoreMatchers.allOf import static org.hamcrest.CoreMatchers.containsString import static org.hamcrest.core.IsNot.not import static org.junit.Assert.assertEquals -import static org.junit.Assert.assertFalse import static org.junit.Assert.assertNotNull import static org.junit.Assert.assertThat import static org.junit.Assert.assertTrue @@ -364,8 +363,6 @@ class MainControllerIntegrationTests extends AbstractInitializrControllerIntegra void homeIsForm() { def body = htmlHome() assertTrue "Wrong body:\n$body", body.contains('action="/starter.zip"') - assertTrue "Must force https", body.contains("https://localhost:$port/install.sh") - assertFalse "Must force https", body.contains('http://') } @Test