Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
1370e9db
Commit
1370e9db
authored
Nov 14, 2017
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10548 from isopov:samples-cleanup
* pr/10548: Polish "Samples cleanup" Samples cleanup
parents
792de8f4
512030f4
Changes
63
Hide whitespace changes
Inline
Side-by-side
Showing
63 changed files
with
139 additions
and
387 deletions
+139
-387
CorsSampleActuatorApplicationTests.java
...or/customsecurity/CorsSampleActuatorApplicationTests.java
+16
-2
InsecureManagementPortAndPathSampleActuatorApplicationTests.java
...eManagementPortAndPathSampleActuatorApplicationTests.java
+0
-2
SampleActuatorCustomSecurityApplicationTests.java
...ecurity/SampleActuatorCustomSecurityApplicationTests.java
+16
-2
SampleActuatorUiApplicationPortTests.java
...ple/actuator/ui/SampleActuatorUiApplicationPortTests.java
+0
-2
SampleActuatorUiApplicationTests.java
.../sample/actuator/ui/SampleActuatorUiApplicationTests.java
+0
-2
EndpointsPropertiesSampleActuatorApplicationTests.java
...or/EndpointsPropertiesSampleActuatorApplicationTests.java
+0
-2
ManagementAddressActuatorApplicationTests.java
...e/actuator/ManagementAddressActuatorApplicationTests.java
+0
-2
ManagementPathSampleActuatorApplicationTests.java
...ctuator/ManagementPathSampleActuatorApplicationTests.java
+0
-2
ManagementPortAndPathSampleActuatorApplicationTests.java
.../ManagementPortAndPathSampleActuatorApplicationTests.java
+0
-2
ManagementPortSampleActuatorApplicationTests.java
...ctuator/ManagementPortSampleActuatorApplicationTests.java
+0
-2
NoManagementSampleActuatorApplicationTests.java
.../actuator/NoManagementSampleActuatorApplicationTests.java
+0
-2
SampleActuatorApplicationTests.java
.../java/sample/actuator/SampleActuatorApplicationTests.java
+0
-2
ServletPathSampleActuatorApplicationTests.java
...e/actuator/ServletPathSampleActuatorApplicationTests.java
+0
-2
ShutdownSampleActuatorApplicationTests.java
...mple/actuator/ShutdownSampleActuatorApplicationTests.java
+0
-2
SampleAtmosphereApplicationTests.java
...a/sample/atmosphere/SampleAtmosphereApplicationTests.java
+0
-2
SampleDevToolsApplicationIntegrationTests.java
...e/devtools/SampleDevToolsApplicationIntegrationTests.java
+0
-2
pom.xml
spring-boot-samples/spring-boot-sample-jetty-jsp/pom.xml
+0
-10
SampleWebJspApplicationTests.java
...t/java/sample/jetty/jsp/SampleWebJspApplicationTests.java
+1
-3
pom.xml
spring-boot-samples/spring-boot-sample-jetty-ssl/pom.xml
+7
-5
HelloWorldService.java
...main/java/sample/jetty/ssl/service/HelloWorldService.java
+0
-32
SampleController.java
.../src/main/java/sample/jetty/ssl/web/SampleController.java
+4
-12
SampleJettySslApplicationTests.java
...java/sample/jetty/ssl/SampleJettySslApplicationTests.java
+12
-10
pom.xml
spring-boot-samples/spring-boot-sample-jetty/pom.xml
+7
-5
SampleJettyApplicationTests.java
...c/test/java/sample/jetty/SampleJettyApplicationTests.java
+0
-2
SampleOAuth2ClientApplicationTests.java
...ple/oauth2/client/SampleOAuth2ClientApplicationTests.java
+0
-2
SampleSecureWebFluxApplicationTests.java
...e/secure/webflux/SampleSecureWebFluxApplicationTests.java
+0
-2
SampleServletApplicationTests.java
...st/java/sample/servlet/SampleServletApplicationTests.java
+0
-2
SampleTestNGApplicationTests.java
...test/java/sample/testng/SampleTestNGApplicationTests.java
+1
-3
pom.xml
spring-boot-samples/spring-boot-sample-tomcat-jsp/pom.xml
+0
-5
SampleWebJspApplicationTests.java
.../java/sample/tomcat/jsp/SampleWebJspApplicationTests.java
+1
-3
pom.xml
...amples/spring-boot-sample-tomcat-multi-connectors/pom.xml
+6
-9
SampleTomcatTwoConnectorsApplicationTests.java
...iconnector/SampleTomcatTwoConnectorsApplicationTests.java
+15
-78
pom.xml
spring-boot-samples/spring-boot-sample-tomcat-ssl/pom.xml
+4
-15
SampleController.java
...src/main/java/sample/tomcat/ssl/web/SampleController.java
+3
-5
SampleTomcatSslApplicationTests.java
...va/sample/tomcat/ssl/SampleTomcatSslApplicationTests.java
+10
-3
NonAutoConfigurationSampleTomcatApplicationTests.java
...cat/NonAutoConfigurationSampleTomcatApplicationTests.java
+0
-2
SampleTomcatApplicationTests.java
...test/java/sample/tomcat/SampleTomcatApplicationTests.java
+0
-2
SampleTraditionalApplicationTests.java
...sample/traditional/SampleTraditionalApplicationTests.java
+1
-3
pom.xml
spring-boot-samples/spring-boot-sample-undertow-ssl/pom.xml
+7
-6
HelloWorldService.java
...n/java/sample/undertow/ssl/service/HelloWorldService.java
+0
-32
SampleController.java
...c/main/java/sample/undertow/ssl/web/SampleController.java
+4
-12
SampleUndertowSslApplicationTests.java
...ample/undertow/ssl/SampleUndertowSslApplicationTests.java
+11
-4
pom.xml
spring-boot-samples/spring-boot-sample-undertow/pom.xml
+7
-5
HelloWorldService.java
.../main/java/sample/undertow/service/HelloWorldService.java
+0
-32
SampleController.java
...w/src/main/java/sample/undertow/web/SampleController.java
+3
-12
SampleUndertowApplicationTests.java
.../java/sample/undertow/SampleUndertowApplicationTests.java
+0
-2
SampleWebFreeMarkerApplicationTests.java
...ample/freemarker/SampleWebFreeMarkerApplicationTests.java
+0
-2
MessageControllerWebTests.java
...ava/sample/groovytemplates/MessageControllerWebTests.java
+1
-3
SampleGroovyTemplateApplicationTests.java
...groovytemplates/SampleGroovyTemplateApplicationTests.java
+0
-2
SampleWebJspApplicationTests.java
...rc/test/java/sample/jsp/SampleWebJspApplicationTests.java
+1
-3
SampleMethodSecurityApplicationTests.java
...security/method/SampleMethodSecurityApplicationTests.java
+0
-2
SampleWebMustacheApplicationTests.java
...va/sample/mustache/SampleWebMustacheApplicationTests.java
+0
-2
SampleWebSecureCustomApplicationTests.java
.../secure/custom/SampleWebSecureCustomApplicationTests.java
+0
-2
SampleWebSecureJdbcApplicationTests.java
.../web/secure/jdbc/SampleWebSecureJdbcApplicationTests.java
+0
-2
SampleSecureApplicationTests.java
.../java/sample/web/secure/SampleSecureApplicationTests.java
+0
-2
SampleWebStaticApplicationTests.java
...le/web/staticcontent/SampleWebStaticApplicationTests.java
+1
-3
SampleWebUiApplicationTests.java
.../test/java/sample/web/ui/SampleWebUiApplicationTests.java
+0
-2
SampleWebSocketsApplicationTests.java
...les/websocket/jetty/SampleWebSocketsApplicationTests.java
+0
-2
CustomContainerWebSocketsApplicationTests.java
...jetty/echo/CustomContainerWebSocketsApplicationTests.java
+0
-2
SampleWebSocketsApplicationTests.java
...es/websocket/tomcat/SampleWebSocketsApplicationTests.java
+0
-2
CustomContainerWebSocketsApplicationTests.java
...omcat/echo/CustomContainerWebSocketsApplicationTests.java
+0
-2
SampleWebSocketsApplicationTests.java
.../websocket/undertow/SampleWebSocketsApplicationTests.java
+0
-2
CustomContainerWebSocketsApplicationTests.java
...ertow/echo/CustomContainerWebSocketsApplicationTests.java
+0
-2
No files found.
spring-boot-samples/spring-boot-sample-actuator-custom-security/src/test/java/sample/actuator/customsecurity/CorsSampleActuatorApplicationTests.java
View file @
1370e9db
/*
* Copyright 2012-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
sample
.
actuator
.
customsecurity
;
import
java.net.URI
;
...
...
@@ -16,7 +32,6 @@ import org.springframework.http.HttpStatus;
import
org.springframework.http.RequestEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.client.HttpComponentsClientHttpRequestFactory
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.ActiveProfiles
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.web.client.RestTemplate
;
...
...
@@ -30,7 +45,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
SpringBootTest
.
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
@ActiveProfiles
(
"cors"
)
public
class
CorsSampleActuatorApplicationTests
{
...
...
spring-boot-samples/spring-boot-sample-actuator-custom-security/src/test/java/sample/actuator/customsecurity/InsecureManagementPortAndPathSampleActuatorApplicationTests.java
View file @
1370e9db
...
...
@@ -26,7 +26,6 @@ import org.springframework.boot.test.web.client.TestRestTemplate;
import
org.springframework.boot.web.server.LocalServerPort
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -40,7 +39,6 @@ import static org.assertj.core.api.Assertions.assertThat;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
,
properties
=
{
"management.server.port=0"
,
"management.server.context-path=/management"
})
@DirtiesContext
public
class
InsecureManagementPortAndPathSampleActuatorApplicationTests
{
@LocalServerPort
...
...
spring-boot-samples/spring-boot-sample-actuator-custom-security/src/test/java/sample/actuator/customsecurity/SampleActuatorCustomSecurityApplicationTests.java
View file @
1370e9db
/*
* Copyright 2012-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
sample
.
actuator
.
customsecurity
;
import
java.util.Map
;
...
...
@@ -10,7 +26,6 @@ import org.springframework.boot.test.context.SpringBootTest;
import
org.springframework.boot.test.web.client.TestRestTemplate
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -20,7 +35,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
SpringBootTest
.
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
SampleActuatorCustomSecurityApplicationTests
{
@Autowired
...
...
spring-boot-samples/spring-boot-sample-actuator-ui/src/test/java/sample/actuator/ui/SampleActuatorUiApplicationPortTests.java
View file @
1370e9db
...
...
@@ -28,7 +28,6 @@ import org.springframework.boot.test.web.client.TestRestTemplate;
import
org.springframework.boot.web.server.LocalServerPort
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -41,7 +40,6 @@ import static org.assertj.core.api.Assertions.assertThat;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
,
properties
=
{
"management.server.port:0"
})
@DirtiesContext
public
class
SampleActuatorUiApplicationPortTests
{
@LocalServerPort
...
...
spring-boot-samples/spring-boot-sample-actuator-ui/src/test/java/sample/actuator/ui/SampleActuatorUiApplicationTests.java
View file @
1370e9db
...
...
@@ -32,7 +32,6 @@ import org.springframework.http.HttpMethod;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -44,7 +43,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
SampleActuatorUiApplicationTests
{
@Autowired
...
...
spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/EndpointsPropertiesSampleActuatorApplicationTests.java
View file @
1370e9db
...
...
@@ -27,7 +27,6 @@ import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import
org.springframework.boot.test.web.client.TestRestTemplate
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.ActiveProfiles
;
import
org.springframework.test.context.junit4.SpringRunner
;
...
...
@@ -40,7 +39,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
@ActiveProfiles
(
"endpoints"
)
public
class
EndpointsPropertiesSampleActuatorApplicationTests
{
...
...
spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/ManagementAddressActuatorApplicationTests.java
View file @
1370e9db
...
...
@@ -28,7 +28,6 @@ import org.springframework.boot.test.web.client.TestRestTemplate;
import
org.springframework.boot.web.server.LocalServerPort
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -42,7 +41,6 @@ import static org.assertj.core.api.Assertions.assertThat;
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
,
properties
=
{
"management.server.port=0"
,
"management.server.address=127.0.0.1"
,
"management.server.context-path:/admin"
})
@DirtiesContext
public
class
ManagementAddressActuatorApplicationTests
{
@LocalServerPort
...
...
spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/ManagementPathSampleActuatorApplicationTests.java
View file @
1370e9db
...
...
@@ -27,7 +27,6 @@ import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import
org.springframework.boot.test.web.client.TestRestTemplate
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -40,7 +39,6 @@ import static org.assertj.core.api.Assertions.assertThat;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
,
properties
=
{
"management.endpoints.web.base-path=/admin"
})
@DirtiesContext
public
class
ManagementPathSampleActuatorApplicationTests
{
@Autowired
...
...
spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/ManagementPortAndPathSampleActuatorApplicationTests.java
View file @
1370e9db
...
...
@@ -28,7 +28,6 @@ import org.springframework.boot.test.web.client.TestRestTemplate;
import
org.springframework.boot.web.server.LocalServerPort
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -41,7 +40,6 @@ import static org.assertj.core.api.Assertions.assertThat;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
,
properties
=
{
"management.server.port=0"
,
"management.endpoints.web.base-path=/admin"
})
@DirtiesContext
public
class
ManagementPortAndPathSampleActuatorApplicationTests
{
@LocalServerPort
...
...
spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/ManagementPortSampleActuatorApplicationTests.java
View file @
1370e9db
...
...
@@ -28,7 +28,6 @@ import org.springframework.boot.test.web.client.TestRestTemplate;
import
org.springframework.boot.web.server.LocalServerPort
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -41,7 +40,6 @@ import static org.assertj.core.api.Assertions.assertThat;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
,
properties
=
{
"management.server.port=0"
})
@DirtiesContext
public
class
ManagementPortSampleActuatorApplicationTests
{
@LocalServerPort
...
...
spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/NoManagementSampleActuatorApplicationTests.java
View file @
1370e9db
...
...
@@ -27,7 +27,6 @@ import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import
org.springframework.boot.test.web.client.TestRestTemplate
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -40,7 +39,6 @@ import static org.assertj.core.api.Assertions.assertThat;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
,
properties
=
{
"management.server.port=-1"
})
@DirtiesContext
public
class
NoManagementSampleActuatorApplicationTests
{
@Autowired
...
...
spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/SampleActuatorApplicationTests.java
View file @
1370e9db
...
...
@@ -34,7 +34,6 @@ import org.springframework.http.HttpMethod;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -47,7 +46,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
SampleActuatorApplicationTests
{
@Autowired
...
...
spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/ServletPathSampleActuatorApplicationTests.java
View file @
1370e9db
...
...
@@ -27,7 +27,6 @@ import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import
org.springframework.boot.test.web.client.TestRestTemplate
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -40,7 +39,6 @@ import static org.assertj.core.api.Assertions.assertThat;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
,
properties
=
{
"server.servlet.path=/spring"
})
@DirtiesContext
public
class
ServletPathSampleActuatorApplicationTests
{
@Autowired
...
...
spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/ShutdownSampleActuatorApplicationTests.java
View file @
1370e9db
...
...
@@ -27,7 +27,6 @@ import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import
org.springframework.boot.test.web.client.TestRestTemplate
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -39,7 +38,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
ShutdownSampleActuatorApplicationTests
{
@Autowired
...
...
spring-boot-samples/spring-boot-sample-atmosphere/src/test/java/sample/atmosphere/SampleAtmosphereApplicationTests.java
View file @
1370e9db
...
...
@@ -35,7 +35,6 @@ import org.springframework.boot.web.server.LocalServerPort;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.web.socket.TextMessage
;
import
org.springframework.web.socket.WebSocketSession
;
...
...
@@ -47,7 +46,6 @@ import static org.assertj.core.api.Assertions.assertThat;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
SampleAtmosphereApplication
.
class
,
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
SampleAtmosphereApplicationTests
{
private
static
Log
logger
=
LogFactory
.
getLog
(
SampleAtmosphereApplicationTests
.
class
);
...
...
spring-boot-samples/spring-boot-sample-devtools/src/test/java/sample/devtools/SampleDevToolsApplicationIntegrationTests.java
View file @
1370e9db
...
...
@@ -25,7 +25,6 @@ import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import
org.springframework.boot.test.web.client.TestRestTemplate
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -38,7 +37,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
SampleDevToolsApplicationIntegrationTests
{
@Autowired
...
...
spring-boot-samples/spring-boot-sample-jetty-jsp/pom.xml
View file @
1370e9db
...
...
@@ -28,16 +28,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-validation
</artifactId>
<exclusions>
<exclusion>
<groupId>
org.apache.tomcat.embed
</groupId>
<artifactId>
tomcat-embed-el
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
javax.servlet
</groupId>
<artifactId>
jstl
</artifactId>
...
...
spring-boot-samples/spring-boot-sample-jetty-jsp/src/test/java/sample/jetty/jsp/SampleWebJspApplicationTests.java
View file @
1370e9db
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -25,7 +25,6 @@ import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import
org.springframework.boot.test.web.client.TestRestTemplate
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -37,7 +36,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
SampleWebJspApplicationTests
{
@Autowired
...
...
spring-boot-samples/spring-boot-sample-jetty-ssl/pom.xml
View file @
1370e9db
...
...
@@ -18,16 +18,18 @@
<!-- Compile -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter
</artifactId>
<artifactId>
spring-boot-starter-web
</artifactId>
<exclusions>
<exclusion>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-tomcat
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-jetty
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-webmvc
</artifactId>
</dependency>
<!-- Test -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
spring-boot-samples/spring-boot-sample-jetty-ssl/src/main/java/sample/jetty/ssl/service/HelloWorldService.java
deleted
100644 → 0
View file @
792de8f4
/*
* Copyright 2012-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
sample
.
jetty
.
ssl
.
service
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
@Component
public
class
HelloWorldService
{
@Value
(
"${name:World}"
)
private
String
name
;
public
String
getHelloMessage
()
{
return
"Hello "
+
this
.
name
;
}
}
spring-boot-samples/spring-boot-sample-jetty-ssl/src/main/java/sample/jetty/ssl/web/SampleController.java
View file @
1370e9db
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -16,23 +16,15 @@
package
sample
.
jetty
.
ssl
.
web
;
import
sample.jetty.ssl.service.HelloWorldService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.Res
ponseBody
;
import
org.springframework.web.bind.annotation.Res
tController
;
@Controller
@
Rest
Controller
public
class
SampleController
{
@Autowired
private
HelloWorldService
helloWorldService
;
@GetMapping
(
"/"
)
@ResponseBody
public
String
helloWorld
()
{
return
this
.
helloWorldService
.
getHelloMessage
()
;
return
"Hello World"
;
}
}
spring-boot-samples/spring-boot-sample-jetty-ssl/src/test/java/sample/jetty/ssl/SampleJettySslApplicationTests.java
View file @
1370e9db
...
...
@@ -19,14 +19,13 @@ package sample.jetty.ssl;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest.WebEnvironment
;
import
org.springframework.boot.test.web.client.TestRestTemplate
;
import
org.springframework.boot.test.web.client.TestRestTemplate.HttpClientOption
;
import
org.springframework.boot.web.server.LocalServerPort
;
import
org.springframework.boot.web.server.AbstractConfigurableWebServerFactory
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -38,19 +37,22 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
SampleJettySslApplicationTests
{
@LocalServerPort
private
int
port
;
@Autowired
private
TestRestTemplate
restTemplate
;
@Autowired
private
AbstractConfigurableWebServerFactory
webServerFactory
;
@Test
public
void
testSsl
()
{
assertThat
(
this
.
webServerFactory
.
getSsl
().
isEnabled
()).
isTrue
();
}
@Test
public
void
testHome
()
throws
Exception
{
TestRestTemplate
testRestTemplate
=
new
TestRestTemplate
(
HttpClientOption
.
SSL
);
ResponseEntity
<
String
>
entity
=
testRestTemplate
.
getForEntity
(
"https://localhost:"
+
this
.
port
,
String
.
class
);
ResponseEntity
<
String
>
entity
=
this
.
restTemplate
.
getForEntity
(
"/"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
assertThat
(
entity
.
getBody
()).
isEqualTo
(
"Hello World"
);
}
}
spring-boot-samples/spring-boot-sample-jetty/pom.xml
View file @
1370e9db
...
...
@@ -18,16 +18,18 @@
<!-- Compile -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter
</artifactId>
<artifactId>
spring-boot-starter-web
</artifactId>
<exclusions>
<exclusion>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-tomcat
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-jetty
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-webmvc
</artifactId>
</dependency>
<!-- Test -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
spring-boot-samples/spring-boot-sample-jetty/src/test/java/sample/jetty/SampleJettyApplicationTests.java
View file @
1370e9db
...
...
@@ -32,7 +32,6 @@ import org.springframework.http.HttpHeaders;
import
org.springframework.http.HttpMethod
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.util.StreamUtils
;
...
...
@@ -46,7 +45,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
SampleJettyApplicationTests
{
@Autowired
...
...
spring-boot-samples/spring-boot-sample-oauth2-client/src/test/java/sample/oauth2/client/SampleOAuth2ClientApplicationTests.java
View file @
1370e9db
...
...
@@ -27,7 +27,6 @@ import org.springframework.boot.test.web.client.TestRestTemplate;
import
org.springframework.boot.web.server.LocalServerPort
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -35,7 +34,6 @@ import static org.assertj.core.api.Assertions.assertThat;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
SpringBootTest
.
WebEnvironment
.
RANDOM_PORT
,
properties
=
{
"APP-CLIENT-ID=my-client-id"
,
"APP-CLIENT-SECRET=my-client-secret"
})
@DirtiesContext
public
class
SampleOAuth2ClientApplicationTests
{
@LocalServerPort
...
...
spring-boot-samples/spring-boot-sample-secure-webflux/src/test/java/sample/secure/webflux/SampleSecureWebFluxApplicationTests.java
View file @
1370e9db
...
...
@@ -25,7 +25,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.web.reactive.server.WebTestClient
;
...
...
@@ -36,7 +35,6 @@ import org.springframework.test.web.reactive.server.WebTestClient;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
SpringBootTest
.
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
SampleSecureWebFluxApplicationTests
{
@Autowired
...
...
spring-boot-samples/spring-boot-sample-servlet/src/test/java/sample/servlet/SampleServletApplicationTests.java
View file @
1370e9db
...
...
@@ -31,7 +31,6 @@ import org.springframework.http.HttpMethod;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -43,7 +42,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
SampleServletApplicationTests
{
@Autowired
...
...
spring-boot-samples/spring-boot-sample-testng/src/test/java/sample/testng/SampleTestNGApplicationTests.java
View file @
1370e9db
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -24,7 +24,6 @@ import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import
org.springframework.boot.test.web.client.TestRestTemplate
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.testng.AbstractTestNGSpringContextTests
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -35,7 +34,6 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Phillip Webb
*/
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
SampleTestNGApplicationTests
extends
AbstractTestNGSpringContextTests
{
@Autowired
...
...
spring-boot-samples/spring-boot-sample-tomcat-jsp/pom.xml
View file @
1370e9db
...
...
@@ -27,11 +27,6 @@
<artifactId>
jstl
</artifactId>
</dependency>
<!-- Provided -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-tomcat
</artifactId>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
org.apache.tomcat.embed
</groupId>
<artifactId>
tomcat-embed-jasper
</artifactId>
...
...
spring-boot-samples/spring-boot-sample-tomcat-jsp/src/test/java/sample/tomcat/jsp/SampleWebJspApplicationTests.java
View file @
1370e9db
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -25,7 +25,6 @@ import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import
org.springframework.boot.test.web.client.TestRestTemplate
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -37,7 +36,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
SampleWebJspApplicationTests
{
@Autowired
...
...
spring-boot-samples/spring-boot-sample-tomcat-multi-connectors/pom.xml
View file @
1370e9db
...
...
@@ -18,15 +18,7 @@
<!-- Compile -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-tomcat
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-webmvc
</artifactId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<!-- Test -->
<dependency>
...
...
@@ -34,6 +26,11 @@
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.apache.httpcomponents
</groupId>
<artifactId>
httpclient
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
<build>
<plugins>
...
...
spring-boot-samples/spring-boot-sample-tomcat-multi-connectors/src/test/java/sample/tomcat/multiconnector/SampleTomcatTwoConnectorsApplicationTests.java
View file @
1370e9db
...
...
@@ -16,18 +16,8 @@
package
sample
.
tomcat
.
multiconnector
;
import
java.io.IOException
;
import
java.net.HttpURLConnection
;
import
javax.net.ssl.HostnameVerifier
;
import
javax.net.ssl.HttpsURLConnection
;
import
javax.net.ssl.SSLContext
;
import
javax.net.ssl.TrustManager
;
import
javax.net.ssl.X509TrustManager
;
import
org.apache.catalina.Service
;
import
org.apache.catalina.connector.Connector
;
import
org.junit.BeforeClass
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
sample.tomcat.multiconnector.SampleTomcatTwoConnectorsApplicationTests.Ports
;
...
...
@@ -36,18 +26,16 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest.WebEnvironment
;
import
org.springframework.boot.test.context.TestConfiguration
;
import
org.springframework.boot.test.web.client.TestRestTemplate
;
import
org.springframework.boot.web.context.WebServerInitializedEvent
;
import
org.springframework.boot.web.embedded.tomcat.TomcatWebServer
;
import
org.springframework.boot.web.server.AbstractConfigurableWebServerFactory
;
import
org.springframework.boot.web.server.LocalServerPort
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationListener
;
import
org.springframework.context.annotation.Import
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.client.SimpleClientHttpRequestFactory
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.web.client.RestTemplate
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -59,88 +47,37 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
@Import
(
Ports
.
class
)
public
class
SampleTomcatTwoConnectorsApplicationTests
{
@LocalServerPort
private
int
port
;
@Autowired
private
ApplicationContext
context
;
@BeforeClass
public
static
void
setUp
()
{
try
{
// setup ssl context to ignore certificate errors
SSLContext
ctx
=
SSLContext
.
getInstance
(
"TLS"
);
X509TrustManager
tm
=
new
X509TrustManager
()
{
@Override
public
void
checkClientTrusted
(
java
.
security
.
cert
.
X509Certificate
[]
chain
,
String
authType
)
throws
java
.
security
.
cert
.
CertificateException
{
}
@Override
public
void
checkServerTrusted
(
java
.
security
.
cert
.
X509Certificate
[]
chain
,
String
authType
)
throws
java
.
security
.
cert
.
CertificateException
{
}
@Override
public
java
.
security
.
cert
.
X509Certificate
[]
getAcceptedIssuers
()
{
return
null
;
}
};
ctx
.
init
(
null
,
new
TrustManager
[]
{
tm
},
null
);
SSLContext
.
setDefault
(
ctx
);
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
}
private
Ports
ports
;
@Autowired
private
TestRestTemplate
restTemplate
;
@Autowired
private
AbstractConfigurableWebServerFactory
webServerFactory
;
@Test
public
void
testSsl
()
{
assertThat
(
this
.
webServerFactory
.
getSsl
().
isEnabled
()).
isTrue
();
}
@Test
public
void
testHello
()
throws
Exception
{
RestTemplate
template
=
new
RestTemplate
();
final
MySimpleClientHttpRequestFactory
factory
=
new
MySimpleClientHttpRequestFactory
(
(
hostname
,
session
)
->
true
);
template
.
setRequestFactory
(
factory
);
Ports
ports
=
this
.
context
.
getBean
(
Ports
.
class
);
assertThat
(
ports
.
getHttpsPort
()).
isEqualTo
(
this
.
port
);
assertThat
(
ports
.
getHttpPort
()).
isNotEqualTo
(
this
.
port
);
ResponseEntity
<
String
>
entity
=
template
.
getForEntity
(
"http://localhost:"
+
ports
.
getHttpPort
()
+
"/hello"
,
String
.
class
);
assertThat
(
this
.
ports
.
getHttpsPort
()).
isEqualTo
(
this
.
port
);
assertThat
(
this
.
ports
.
getHttpPort
()).
isNotEqualTo
(
this
.
port
);
ResponseEntity
<
String
>
entity
=
this
.
restTemplate
.
getForEntity
(
"http://localhost:"
+
this
.
ports
.
getHttpPort
()
+
"/hello"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
assertThat
(
entity
.
getBody
()).
isEqualTo
(
"hello"
);
ResponseEntity
<
String
>
httpsEntity
=
template
ResponseEntity
<
String
>
httpsEntity
=
t
his
.
restT
emplate
.
getForEntity
(
"https://localhost:"
+
this
.
port
+
"/hello"
,
String
.
class
);
assertThat
(
httpsEntity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
assertThat
(
httpsEntity
.
getBody
()).
isEqualTo
(
"hello"
);
}
/**
* Http Request Factory for ignoring SSL hostname errors. Not for production use!
*/
class
MySimpleClientHttpRequestFactory
extends
SimpleClientHttpRequestFactory
{
private
final
HostnameVerifier
verifier
;
public
MySimpleClientHttpRequestFactory
(
final
HostnameVerifier
verifier
)
{
this
.
verifier
=
verifier
;
}
@Override
protected
void
prepareConnection
(
final
HttpURLConnection
connection
,
final
String
httpMethod
)
throws
IOException
{
if
(
connection
instanceof
HttpsURLConnection
)
{
((
HttpsURLConnection
)
connection
).
setHostnameVerifier
(
this
.
verifier
);
}
super
.
prepareConnection
(
connection
,
httpMethod
);
}
}
@TestConfiguration
static
class
Ports
implements
ApplicationListener
<
WebServerInitializedEvent
>
{
...
...
spring-boot-samples/spring-boot-sample-tomcat-ssl/pom.xml
View file @
1370e9db
...
...
@@ -18,19 +18,7 @@
<!-- Compile -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-tomcat
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-webmvc
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.httpcomponents
</groupId>
<artifactId>
httpclient
</artifactId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<!-- Test -->
<dependency>
...
...
@@ -39,8 +27,9 @@
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.yaml
</groupId>
<artifactId>
snakeyaml
</artifactId>
<groupId>
org.apache.httpcomponents
</groupId>
<artifactId>
httpclient
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
<build>
...
...
spring-boot-samples/spring-boot-sample-tomcat-ssl/src/main/java/sample/tomcat/ssl/web/SampleController.java
View file @
1370e9db
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -16,15 +16,13 @@
package
sample
.
tomcat
.
ssl
.
web
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.Res
ponseBody
;
import
org.springframework.web.bind.annotation.Res
tController
;
@Controller
@
Rest
Controller
public
class
SampleController
{
@GetMapping
(
"/"
)
@ResponseBody
public
String
helloWorld
()
{
return
"Hello, world"
;
}
...
...
spring-boot-samples/spring-boot-sample-tomcat-ssl/src/test/java/sample/tomcat/ssl/SampleTomcatSslApplicationTests.java
View file @
1370e9db
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -23,21 +23,28 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest.WebEnvironment
;
import
org.springframework.boot.test.web.client.TestRestTemplate
;
import
org.springframework.boot.web.server.AbstractConfigurableWebServerFactory
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
SampleTomcatSslApplicationTests
{
@Autowired
private
TestRestTemplate
restTemplate
;
@Autowired
private
AbstractConfigurableWebServerFactory
webServerFactory
;
@Test
public
void
testSsl
()
{
assertThat
(
this
.
webServerFactory
.
getSsl
().
isEnabled
()).
isTrue
();
}
@Test
public
void
testHome
()
throws
Exception
{
ResponseEntity
<
String
>
entity
=
this
.
restTemplate
.
getForEntity
(
"/"
,
String
.
class
);
...
...
spring-boot-samples/spring-boot-sample-tomcat/src/test/java/sample/tomcat/NonAutoConfigurationSampleTomcatApplicationTests.java
View file @
1370e9db
...
...
@@ -36,7 +36,6 @@ import org.springframework.context.annotation.Configuration;
import
org.springframework.context.annotation.Import
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -48,7 +47,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
NonAutoConfigurationSampleTomcatApplicationTests
{
@Autowired
...
...
spring-boot-samples/spring-boot-sample-tomcat/src/test/java/sample/tomcat/SampleTomcatApplicationTests.java
View file @
1370e9db
...
...
@@ -37,7 +37,6 @@ import org.springframework.http.HttpHeaders;
import
org.springframework.http.HttpMethod
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.util.StreamUtils
;
...
...
@@ -51,7 +50,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
SampleTomcatApplicationTests
{
@Autowired
...
...
spring-boot-samples/spring-boot-sample-traditional/src/test/java/sample/traditional/SampleTraditionalApplicationTests.java
View file @
1370e9db
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -25,7 +25,6 @@ import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import
org.springframework.boot.test.web.client.TestRestTemplate
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -37,7 +36,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
SampleTraditionalApplicationTests
{
@Autowired
...
...
spring-boot-samples/spring-boot-sample-undertow-ssl/pom.xml
View file @
1370e9db
...
...
@@ -15,19 +15,20 @@
<main.basedir>
${basedir}/../..
</main.basedir>
</properties>
<dependencies>
<!-- Compile -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter
</artifactId>
<artifactId>
spring-boot-starter-web
</artifactId>
<exclusions>
<exclusion>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-tomcat
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-undertow
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-webmvc
</artifactId>
</dependency>
<!-- Test -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
spring-boot-samples/spring-boot-sample-undertow-ssl/src/main/java/sample/undertow/ssl/service/HelloWorldService.java
deleted
100644 → 0
View file @
792de8f4
/*
* Copyright 2012-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
sample
.
undertow
.
ssl
.
service
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
@Component
public
class
HelloWorldService
{
@Value
(
"${name:World}"
)
private
String
name
;
public
String
getHelloMessage
()
{
return
"Hello "
+
this
.
name
;
}
}
spring-boot-samples/spring-boot-sample-undertow-ssl/src/main/java/sample/undertow/ssl/web/SampleController.java
View file @
1370e9db
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -16,23 +16,15 @@
package
sample
.
undertow
.
ssl
.
web
;
import
sample.undertow.ssl.service.HelloWorldService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.Res
ponseBody
;
import
org.springframework.web.bind.annotation.Res
tController
;
@Controller
@
Rest
Controller
public
class
SampleController
{
@Autowired
private
HelloWorldService
helloWorldService
;
@GetMapping
(
"/"
)
@ResponseBody
public
String
helloWorld
()
{
return
this
.
helloWorldService
.
getHelloMessage
()
;
return
"Hello World"
;
}
}
spring-boot-samples/spring-boot-sample-undertow-ssl/src/test/java/sample/undertow/ssl/SampleUndertowSslApplicationTests.java
View file @
1370e9db
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -23,9 +23,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest.WebEnvironment
;
import
org.springframework.boot.test.web.client.TestRestTemplate
;
import
org.springframework.boot.web.server.AbstractConfigurableWebServerFactory
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -37,14 +37,21 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
SampleUndertowSslApplicationTests
{
@Autowired
private
TestRestTemplate
restTemplate
;
@Autowired
private
AbstractConfigurableWebServerFactory
webServerFactory
;
@Test
public
void
testSsl
()
{
assertThat
(
this
.
webServerFactory
.
getSsl
().
isEnabled
()).
isTrue
();
}
@Test
public
void
testHome
()
throws
Exception
{
public
void
testHome
()
{
ResponseEntity
<
String
>
entity
=
this
.
restTemplate
.
getForEntity
(
"/"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
assertThat
(
entity
.
getBody
()).
isEqualTo
(
"Hello World"
);
...
...
spring-boot-samples/spring-boot-sample-undertow/pom.xml
View file @
1370e9db
...
...
@@ -18,16 +18,18 @@
<!-- Compile -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter
</artifactId>
<artifactId>
spring-boot-starter-web
</artifactId>
<exclusions>
<exclusion>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-tomcat
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-undertow
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-webmvc
</artifactId>
</dependency>
<!-- Test -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
spring-boot-samples/spring-boot-sample-undertow/src/main/java/sample/undertow/service/HelloWorldService.java
deleted
100644 → 0
View file @
792de8f4
/*
* Copyright 2012-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
sample
.
undertow
.
service
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
@Component
public
class
HelloWorldService
{
@Value
(
"${name:World}"
)
private
String
name
;
public
String
getHelloMessage
()
{
return
"Hello "
+
this
.
name
;
}
}
spring-boot-samples/spring-boot-sample-undertow/src/main/java/sample/undertow/web/SampleController.java
View file @
1370e9db
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -18,21 +18,15 @@ package sample.undertow.web;
import
java.util.concurrent.Callable
;
import
sample.undertow.service.HelloWorldService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
public
class
SampleController
{
@Autowired
private
HelloWorldService
helloWorldService
;
@GetMapping
(
"/"
)
public
String
helloWorld
()
{
return
this
.
helloWorldService
.
getHelloMessage
()
;
return
"Hello World"
;
}
@GetMapping
(
"/async"
)
...
...
@@ -41,12 +35,9 @@ public class SampleController {
@Override
public
String
call
()
throws
Exception
{
return
"async: "
+
SampleController
.
this
.
helloWorldService
.
getHelloMessage
();
return
"async: Hello World"
;
}
};
}
}
spring-boot-samples/spring-boot-sample-undertow/src/test/java/sample/undertow/SampleUndertowApplicationTests.java
View file @
1370e9db
...
...
@@ -32,7 +32,6 @@ import org.springframework.http.HttpHeaders;
import
org.springframework.http.HttpMethod
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.util.StreamUtils
;
...
...
@@ -46,7 +45,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
SampleUndertowApplicationTests
{
@Autowired
...
...
spring-boot-samples/spring-boot-sample-web-freemarker/src/test/java/sample/freemarker/SampleWebFreeMarkerApplicationTests.java
View file @
1370e9db
...
...
@@ -31,7 +31,6 @@ import org.springframework.http.HttpMethod;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -44,7 +43,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
SampleWebFreeMarkerApplicationTests
{
@Autowired
...
...
spring-boot-samples/spring-boot-sample-web-groovy-templates/src/test/java/sample/groovytemplates/MessageControllerWebTests.java
View file @
1370e9db
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -26,7 +26,6 @@ import org.junit.runner.RunWith;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.web.servlet.MockMvc
;
import
org.springframework.test.web.servlet.setup.MockMvcBuilders
;
...
...
@@ -47,7 +46,6 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
@DirtiesContext
public
class
MessageControllerWebTests
{
@Autowired
...
...
spring-boot-samples/spring-boot-sample-web-groovy-templates/src/test/java/sample/groovytemplates/SampleGroovyTemplateApplicationTests.java
View file @
1370e9db
...
...
@@ -28,7 +28,6 @@ import org.springframework.boot.test.web.client.TestRestTemplate;
import
org.springframework.boot.web.server.LocalServerPort
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.MultiValueMap
;
...
...
@@ -42,7 +41,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
SampleGroovyTemplateApplicationTests
{
@LocalServerPort
...
...
spring-boot-samples/spring-boot-sample-web-jsp/src/test/java/sample/jsp/SampleWebJspApplicationTests.java
View file @
1370e9db
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -25,7 +25,6 @@ import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import
org.springframework.boot.test.web.client.TestRestTemplate
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -37,7 +36,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
SampleWebJspApplicationTests
{
@Autowired
...
...
spring-boot-samples/spring-boot-sample-web-method-security/src/test/java/sample/security/method/SampleMethodSecurityApplicationTests.java
View file @
1370e9db
...
...
@@ -35,7 +35,6 @@ import org.springframework.http.HttpStatus;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.client.support.BasicAuthorizationInterceptor
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.MultiValueMap
;
...
...
@@ -49,7 +48,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
SampleMethodSecurityApplicationTests
{
@LocalServerPort
...
...
spring-boot-samples/spring-boot-sample-web-mustache/src/test/java/sample/mustache/SampleWebMustacheApplicationTests.java
View file @
1370e9db
...
...
@@ -31,7 +31,6 @@ import org.springframework.http.HttpMethod;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -44,7 +43,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
SampleWebMustacheApplicationTests
{
@Autowired
...
...
spring-boot-samples/spring-boot-sample-web-secure-custom/src/test/java/sample/web/secure/custom/SampleWebSecureCustomApplicationTests.java
View file @
1370e9db
...
...
@@ -34,7 +34,6 @@ import org.springframework.http.HttpMethod;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.MultiValueMap
;
...
...
@@ -48,7 +47,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
SampleWebSecureCustomApplicationTests
{
@Autowired
...
...
spring-boot-samples/spring-boot-sample-web-secure-jdbc/src/test/java/sample/web/secure/jdbc/SampleWebSecureJdbcApplicationTests.java
View file @
1370e9db
...
...
@@ -34,7 +34,6 @@ import org.springframework.http.HttpMethod;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.MultiValueMap
;
...
...
@@ -48,7 +47,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
SampleWebSecureJdbcApplicationTests
{
@Autowired
...
...
spring-boot-samples/spring-boot-sample-web-secure/src/test/java/sample/web/secure/SampleSecureApplicationTests.java
View file @
1370e9db
...
...
@@ -34,7 +34,6 @@ import org.springframework.http.HttpMethod;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.MultiValueMap
;
...
...
@@ -48,7 +47,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
SampleSecureApplicationTests
{
@Autowired
...
...
spring-boot-samples/spring-boot-sample-web-static/src/test/java/sample/web/staticcontent/SampleWebStaticApplicationTests.java
View file @
1370e9db
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -26,7 +26,6 @@ import org.springframework.boot.test.web.client.TestRestTemplate;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -38,7 +37,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
SampleWebStaticApplicationTests
{
@Autowired
...
...
spring-boot-samples/spring-boot-sample-web-ui/src/test/java/sample/web/ui/SampleWebUiApplicationTests.java
View file @
1370e9db
...
...
@@ -28,7 +28,6 @@ import org.springframework.boot.test.web.client.TestRestTemplate;
import
org.springframework.boot.web.server.LocalServerPort
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.MultiValueMap
;
...
...
@@ -42,7 +41,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
SampleWebUiApplicationTests
{
@Autowired
...
...
spring-boot-samples/spring-boot-sample-websocket-jetty/src/test/java/samples/websocket/jetty/SampleWebSocketsApplicationTests.java
View file @
1370e9db
...
...
@@ -38,7 +38,6 @@ import org.springframework.boot.web.server.LocalServerPort;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.web.socket.client.WebSocketConnectionManager
;
import
org.springframework.web.socket.client.standard.StandardWebSocketClient
;
...
...
@@ -47,7 +46,6 @@ import static org.assertj.core.api.Assertions.assertThat;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
SampleJettyWebSocketsApplication
.
class
,
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
SampleWebSocketsApplicationTests
{
private
static
Log
logger
=
LogFactory
.
getLog
(
SampleWebSocketsApplicationTests
.
class
);
...
...
spring-boot-samples/spring-boot-sample-websocket-jetty/src/test/java/samples/websocket/jetty/echo/CustomContainerWebSocketsApplicationTests.java
View file @
1370e9db
...
...
@@ -42,7 +42,6 @@ import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.web.socket.client.WebSocketConnectionManager
;
import
org.springframework.web.socket.client.standard.StandardWebSocketClient
;
...
...
@@ -52,7 +51,6 @@ import static org.assertj.core.api.Assertions.assertThat;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
{
SampleJettyWebSocketsApplication
.
class
,
CustomContainerConfiguration
.
class
},
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
CustomContainerWebSocketsApplicationTests
{
private
static
Log
logger
=
LogFactory
...
...
spring-boot-samples/spring-boot-sample-websocket-tomcat/src/test/java/samples/websocket/tomcat/SampleWebSocketsApplicationTests.java
View file @
1370e9db
...
...
@@ -38,7 +38,6 @@ import org.springframework.boot.web.server.LocalServerPort;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.web.socket.client.WebSocketConnectionManager
;
import
org.springframework.web.socket.client.standard.StandardWebSocketClient
;
...
...
@@ -47,7 +46,6 @@ import static org.assertj.core.api.Assertions.assertThat;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
SampleTomcatWebSocketApplication
.
class
,
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
SampleWebSocketsApplicationTests
{
private
static
Log
logger
=
LogFactory
.
getLog
(
SampleWebSocketsApplicationTests
.
class
);
...
...
spring-boot-samples/spring-boot-sample-websocket-tomcat/src/test/java/samples/websocket/tomcat/echo/CustomContainerWebSocketsApplicationTests.java
View file @
1370e9db
...
...
@@ -42,7 +42,6 @@ import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.web.socket.client.WebSocketConnectionManager
;
import
org.springframework.web.socket.client.standard.StandardWebSocketClient
;
...
...
@@ -52,7 +51,6 @@ import static org.assertj.core.api.Assertions.assertThat;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
{
SampleTomcatWebSocketApplication
.
class
,
CustomContainerConfiguration
.
class
},
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
CustomContainerWebSocketsApplicationTests
{
private
static
Log
logger
=
LogFactory
...
...
spring-boot-samples/spring-boot-sample-websocket-undertow/src/test/java/samples/websocket/undertow/SampleWebSocketsApplicationTests.java
View file @
1370e9db
...
...
@@ -38,7 +38,6 @@ import org.springframework.boot.web.server.LocalServerPort;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.web.socket.client.WebSocketConnectionManager
;
import
org.springframework.web.socket.client.standard.StandardWebSocketClient
;
...
...
@@ -47,7 +46,6 @@ import static org.assertj.core.api.Assertions.assertThat;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
SampleUndertowWebSocketsApplication
.
class
,
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
SampleWebSocketsApplicationTests
{
private
static
Log
logger
=
LogFactory
.
getLog
(
SampleWebSocketsApplicationTests
.
class
);
...
...
spring-boot-samples/spring-boot-sample-websocket-undertow/src/test/java/samples/websocket/undertow/echo/CustomContainerWebSocketsApplicationTests.java
View file @
1370e9db
...
...
@@ -42,7 +42,6 @@ import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.web.socket.client.WebSocketConnectionManager
;
import
org.springframework.web.socket.client.standard.StandardWebSocketClient
;
...
...
@@ -52,7 +51,6 @@ import static org.assertj.core.api.Assertions.assertThat;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
{
SampleUndertowWebSocketsApplication
.
class
,
CustomContainerConfiguration
.
class
},
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
public
class
CustomContainerWebSocketsApplicationTests
{
private
static
Log
logger
=
LogFactory
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment