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
ded476b5
Commit
ded476b5
authored
Dec 05, 2019
by
dreis2211
Committed by
Andy Wilkinson
Dec 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce visibility of test methods
See gh-19294 See gh-19287
parent
47b47c28
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
69 additions
and
73 deletions
+69
-73
DevToolsIntegrationTests.java
...amework/boot/devtools/tests/DevToolsIntegrationTests.java
+9
-10
DevToolsWithLazyInitializationIntegrationTests.java
...tests/DevToolsWithLazyInitializationIntegrationTests.java
+2
-2
SysVinitLaunchScriptIT.java
...ngframework/boot/launchscript/SysVinitLaunchScriptIT.java
+32
-33
EmbeddedServletContainerJarDevelopmentIntegrationTests.java
...beddedServletContainerJarDevelopmentIntegrationTests.java
+4
-5
EmbeddedServletContainerJarPackagingIntegrationTests.java
...EmbeddedServletContainerJarPackagingIntegrationTests.java
+7
-7
EmbeddedServletContainerWarDevelopmentIntegrationTests.java
...beddedServletContainerWarDevelopmentIntegrationTests.java
+6
-7
EmbeddedServletContainerWarPackagingIntegrationTests.java
...EmbeddedServletContainerWarPackagingIntegrationTests.java
+9
-9
No files found.
spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/DevToolsIntegrationTests.java
View file @
ded476b5
...
...
@@ -32,11 +32,11 @@ import static org.assertj.core.api.Assertions.assertThat;
*
* @author Andy Wilkinson
*/
public
class
DevToolsIntegrationTests
extends
AbstractDevToolsIntegrationTests
{
class
DevToolsIntegrationTests
extends
AbstractDevToolsIntegrationTests
{
@ParameterizedTest
(
name
=
"{0}"
)
@MethodSource
(
"parameters"
)
public
void
addARequestMappingToAnExistingController
(
ApplicationLauncher
applicationLauncher
)
throws
Exception
{
void
addARequestMappingToAnExistingController
(
ApplicationLauncher
applicationLauncher
)
throws
Exception
{
launchApplication
(
applicationLauncher
);
TestRestTemplate
template
=
new
TestRestTemplate
();
String
urlBase
=
"http://localhost:"
+
awaitServerPort
();
...
...
@@ -51,8 +51,7 @@ public class DevToolsIntegrationTests extends AbstractDevToolsIntegrationTests {
@ParameterizedTest
(
name
=
"{0}"
)
@MethodSource
(
"parameters"
)
public
void
removeARequestMappingFromAnExistingController
(
ApplicationLauncher
applicationLauncher
)
throws
Exception
{
void
removeARequestMappingFromAnExistingController
(
ApplicationLauncher
applicationLauncher
)
throws
Exception
{
launchApplication
(
applicationLauncher
);
TestRestTemplate
template
=
new
TestRestTemplate
();
String
urlBase
=
"http://localhost:"
+
awaitServerPort
();
...
...
@@ -65,7 +64,7 @@ public class DevToolsIntegrationTests extends AbstractDevToolsIntegrationTests {
@ParameterizedTest
(
name
=
"{0}"
)
@MethodSource
(
"parameters"
)
public
void
createAController
(
ApplicationLauncher
applicationLauncher
)
throws
Exception
{
void
createAController
(
ApplicationLauncher
applicationLauncher
)
throws
Exception
{
launchApplication
(
applicationLauncher
);
TestRestTemplate
template
=
new
TestRestTemplate
();
String
urlBase
=
"http://localhost:"
+
awaitServerPort
();
...
...
@@ -81,7 +80,7 @@ public class DevToolsIntegrationTests extends AbstractDevToolsIntegrationTests {
@ParameterizedTest
(
name
=
"{0}"
)
@MethodSource
(
"parameters"
)
public
void
createAControllerAndThenAddARequestMapping
(
ApplicationLauncher
applicationLauncher
)
throws
Exception
{
void
createAControllerAndThenAddARequestMapping
(
ApplicationLauncher
applicationLauncher
)
throws
Exception
{
launchApplication
(
applicationLauncher
);
TestRestTemplate
template
=
new
TestRestTemplate
();
String
urlBase
=
"http://localhost:"
+
awaitServerPort
();
...
...
@@ -99,8 +98,8 @@ public class DevToolsIntegrationTests extends AbstractDevToolsIntegrationTests {
@ParameterizedTest
(
name
=
"{0}"
)
@MethodSource
(
"parameters"
)
public
void
createAControllerAndThenAddARequestMappingToAnExistingController
(
ApplicationLauncher
applicationLauncher
)
throws
Exception
{
void
createAControllerAndThenAddARequestMappingToAnExistingController
(
ApplicationLauncher
applicationLauncher
)
throws
Exception
{
launchApplication
(
applicationLauncher
);
TestRestTemplate
template
=
new
TestRestTemplate
();
String
urlBase
=
"http://localhost:"
+
awaitServerPort
();
...
...
@@ -120,7 +119,7 @@ public class DevToolsIntegrationTests extends AbstractDevToolsIntegrationTests {
@ParameterizedTest
(
name
=
"{0}"
)
@MethodSource
(
"parameters"
)
public
void
deleteAController
(
ApplicationLauncher
applicationLauncher
)
throws
Exception
{
void
deleteAController
(
ApplicationLauncher
applicationLauncher
)
throws
Exception
{
launchApplication
(
applicationLauncher
);
TestRestTemplate
template
=
new
TestRestTemplate
();
String
urlBase
=
"http://localhost:"
+
awaitServerPort
();
...
...
@@ -135,7 +134,7 @@ public class DevToolsIntegrationTests extends AbstractDevToolsIntegrationTests {
@ParameterizedTest
(
name
=
"{0}"
)
@MethodSource
(
"parameters"
)
public
void
createAControllerAndThenDeleteIt
(
ApplicationLauncher
applicationLauncher
)
throws
Exception
{
void
createAControllerAndThenDeleteIt
(
ApplicationLauncher
applicationLauncher
)
throws
Exception
{
launchApplication
(
applicationLauncher
);
TestRestTemplate
template
=
new
TestRestTemplate
();
String
urlBase
=
"http://localhost:"
+
awaitServerPort
();
...
...
spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/DevToolsWithLazyInitializationIntegrationTests.java
View file @
ded476b5
...
...
@@ -31,11 +31,11 @@ import static org.assertj.core.api.Assertions.assertThat;
*
* @author Madhura Bhave
*/
public
class
DevToolsWithLazyInitializationIntegrationTests
extends
AbstractDevToolsIntegrationTests
{
class
DevToolsWithLazyInitializationIntegrationTests
extends
AbstractDevToolsIntegrationTests
{
@ParameterizedTest
(
name
=
"{0}"
)
@MethodSource
(
"parameters"
)
public
void
addARequestMappingToAnExistingControllerWhenLazyInit
(
ApplicationLauncher
applicationLauncher
)
void
addARequestMappingToAnExistingControllerWhenLazyInit
(
ApplicationLauncher
applicationLauncher
)
throws
Exception
{
launchApplication
(
applicationLauncher
,
"--spring.main.lazy-initialization=true"
);
TestRestTemplate
template
=
new
TestRestTemplate
();
...
...
spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/java/org/springframework/boot/launchscript/SysVinitLaunchScriptIT.java
View file @
ded476b5
...
...
@@ -61,7 +61,7 @@ import static org.hamcrest.Matchers.containsString;
* @author Andy Wilkinson
* @author Ali Shahbour
*/
public
class
SysVinitLaunchScriptIT
{
class
SysVinitLaunchScriptIT
{
private
final
SpringBootDockerCmdExecFactory
commandExecFactory
=
new
SpringBootDockerCmdExecFactory
();
...
...
@@ -69,7 +69,7 @@ public class SysVinitLaunchScriptIT {
@ParameterizedTest
(
name
=
"{0} {1}"
)
@MethodSource
(
"parameters"
)
public
void
statusWhenStopped
(
String
os
,
String
version
)
throws
Exception
{
void
statusWhenStopped
(
String
os
,
String
version
)
throws
Exception
{
String
output
=
doTest
(
os
,
version
,
"status-when-stopped.sh"
);
assertThat
(
output
).
contains
(
"Status: 3"
);
assertThat
(
output
).
has
(
coloredString
(
AnsiColor
.
RED
,
"Not running"
));
...
...
@@ -77,7 +77,7 @@ public class SysVinitLaunchScriptIT {
@ParameterizedTest
(
name
=
"{0} {1}"
)
@MethodSource
(
"parameters"
)
public
void
statusWhenStarted
(
String
os
,
String
version
)
throws
Exception
{
void
statusWhenStarted
(
String
os
,
String
version
)
throws
Exception
{
String
output
=
doTest
(
os
,
version
,
"status-when-started.sh"
);
assertThat
(
output
).
contains
(
"Status: 0"
);
assertThat
(
output
).
has
(
coloredString
(
AnsiColor
.
GREEN
,
"Started ["
+
extractPid
(
output
)
+
"]"
));
...
...
@@ -85,7 +85,7 @@ public class SysVinitLaunchScriptIT {
@ParameterizedTest
(
name
=
"{0} {1}"
)
@MethodSource
(
"parameters"
)
public
void
statusWhenKilled
(
String
os
,
String
version
)
throws
Exception
{
void
statusWhenKilled
(
String
os
,
String
version
)
throws
Exception
{
String
output
=
doTest
(
os
,
version
,
"status-when-killed.sh"
);
assertThat
(
output
).
contains
(
"Status: 1"
);
assertThat
(
output
)
...
...
@@ -94,7 +94,7 @@ public class SysVinitLaunchScriptIT {
@ParameterizedTest
(
name
=
"{0} {1}"
)
@MethodSource
(
"parameters"
)
public
void
stopWhenStopped
(
String
os
,
String
version
)
throws
Exception
{
void
stopWhenStopped
(
String
os
,
String
version
)
throws
Exception
{
String
output
=
doTest
(
os
,
version
,
"stop-when-stopped.sh"
);
assertThat
(
output
).
contains
(
"Status: 0"
);
assertThat
(
output
).
has
(
coloredString
(
AnsiColor
.
YELLOW
,
"Not running (pidfile not found)"
));
...
...
@@ -102,7 +102,7 @@ public class SysVinitLaunchScriptIT {
@ParameterizedTest
(
name
=
"{0} {1}"
)
@MethodSource
(
"parameters"
)
public
void
forceStopWhenStopped
(
String
os
,
String
version
)
throws
Exception
{
void
forceStopWhenStopped
(
String
os
,
String
version
)
throws
Exception
{
String
output
=
doTest
(
os
,
version
,
"force-stop-when-stopped.sh"
);
assertThat
(
output
).
contains
(
"Status: 0"
);
assertThat
(
output
).
has
(
coloredString
(
AnsiColor
.
YELLOW
,
"Not running (pidfile not found)"
));
...
...
@@ -110,7 +110,7 @@ public class SysVinitLaunchScriptIT {
@ParameterizedTest
(
name
=
"{0} {1}"
)
@MethodSource
(
"parameters"
)
public
void
startWhenStarted
(
String
os
,
String
version
)
throws
Exception
{
void
startWhenStarted
(
String
os
,
String
version
)
throws
Exception
{
String
output
=
doTest
(
os
,
version
,
"start-when-started.sh"
);
assertThat
(
output
).
contains
(
"Status: 0"
);
assertThat
(
output
).
has
(
coloredString
(
AnsiColor
.
YELLOW
,
"Already running ["
+
extractPid
(
output
)
+
"]"
));
...
...
@@ -118,7 +118,7 @@ public class SysVinitLaunchScriptIT {
@ParameterizedTest
(
name
=
"{0} {1}"
)
@MethodSource
(
"parameters"
)
public
void
restartWhenStopped
(
String
os
,
String
version
)
throws
Exception
{
void
restartWhenStopped
(
String
os
,
String
version
)
throws
Exception
{
String
output
=
doTest
(
os
,
version
,
"restart-when-stopped.sh"
);
assertThat
(
output
).
contains
(
"Status: 0"
);
assertThat
(
output
).
has
(
coloredString
(
AnsiColor
.
YELLOW
,
"Not running (pidfile not found)"
));
...
...
@@ -127,7 +127,7 @@ public class SysVinitLaunchScriptIT {
@ParameterizedTest
(
name
=
"{0} {1}"
)
@MethodSource
(
"parameters"
)
public
void
restartWhenStarted
(
String
os
,
String
version
)
throws
Exception
{
void
restartWhenStarted
(
String
os
,
String
version
)
throws
Exception
{
String
output
=
doTest
(
os
,
version
,
"restart-when-started.sh"
);
assertThat
(
output
).
contains
(
"Status: 0"
);
assertThat
(
output
).
has
(
coloredString
(
AnsiColor
.
GREEN
,
"Started ["
+
extract
(
"PID1"
,
output
)
+
"]"
));
...
...
@@ -137,7 +137,7 @@ public class SysVinitLaunchScriptIT {
@ParameterizedTest
(
name
=
"{0} {1}"
)
@MethodSource
(
"parameters"
)
public
void
startWhenStopped
(
String
os
,
String
version
)
throws
Exception
{
void
startWhenStopped
(
String
os
,
String
version
)
throws
Exception
{
String
output
=
doTest
(
os
,
version
,
"start-when-stopped.sh"
);
assertThat
(
output
).
contains
(
"Status: 0"
);
assertThat
(
output
).
has
(
coloredString
(
AnsiColor
.
GREEN
,
"Started ["
+
extractPid
(
output
)
+
"]"
));
...
...
@@ -145,14 +145,14 @@ public class SysVinitLaunchScriptIT {
@ParameterizedTest
(
name
=
"{0} {1}"
)
@MethodSource
(
"parameters"
)
public
void
basicLaunch
(
String
os
,
String
version
)
throws
Exception
{
void
basicLaunch
(
String
os
,
String
version
)
throws
Exception
{
String
output
=
doTest
(
os
,
version
,
"basic-launch.sh"
);
assertThat
(
output
).
doesNotContain
(
"PID_FOLDER"
);
}
@ParameterizedTest
(
name
=
"{0} {1}"
)
@MethodSource
(
"parameters"
)
public
void
launchWithMissingLogFolderGeneratesAWarning
(
String
os
,
String
version
)
throws
Exception
{
void
launchWithMissingLogFolderGeneratesAWarning
(
String
os
,
String
version
)
throws
Exception
{
String
output
=
doTest
(
os
,
version
,
"launch-with-missing-log-folder.sh"
);
assertThat
(
output
).
has
(
coloredString
(
AnsiColor
.
YELLOW
,
"LOG_FOLDER /does/not/exist does not exist. Falling back to /tmp"
));
...
...
@@ -160,7 +160,7 @@ public class SysVinitLaunchScriptIT {
@ParameterizedTest
(
name
=
"{0} {1}"
)
@MethodSource
(
"parameters"
)
public
void
launchWithMissingPidFolderGeneratesAWarning
(
String
os
,
String
version
)
throws
Exception
{
void
launchWithMissingPidFolderGeneratesAWarning
(
String
os
,
String
version
)
throws
Exception
{
String
output
=
doTest
(
os
,
version
,
"launch-with-missing-pid-folder.sh"
);
assertThat
(
output
).
has
(
coloredString
(
AnsiColor
.
YELLOW
,
"PID_FOLDER /does/not/exist does not exist. Falling back to /tmp"
));
...
...
@@ -168,49 +168,49 @@ public class SysVinitLaunchScriptIT {
@ParameterizedTest
(
name
=
"{0} {1}"
)
@MethodSource
(
"parameters"
)
public
void
launchWithSingleCommandLineArgument
(
String
os
,
String
version
)
throws
Exception
{
void
launchWithSingleCommandLineArgument
(
String
os
,
String
version
)
throws
Exception
{
doLaunch
(
os
,
version
,
"launch-with-single-command-line-argument.sh"
);
}
@ParameterizedTest
(
name
=
"{0} {1}"
)
@MethodSource
(
"parameters"
)
public
void
launchWithMultipleCommandLineArguments
(
String
os
,
String
version
)
throws
Exception
{
void
launchWithMultipleCommandLineArguments
(
String
os
,
String
version
)
throws
Exception
{
doLaunch
(
os
,
version
,
"launch-with-multiple-command-line-arguments.sh"
);
}
@ParameterizedTest
(
name
=
"{0} {1}"
)
@MethodSource
(
"parameters"
)
public
void
launchWithSingleRunArg
(
String
os
,
String
version
)
throws
Exception
{
void
launchWithSingleRunArg
(
String
os
,
String
version
)
throws
Exception
{
doLaunch
(
os
,
version
,
"launch-with-single-run-arg.sh"
);
}
@ParameterizedTest
(
name
=
"{0} {1}"
)
@MethodSource
(
"parameters"
)
public
void
launchWithMultipleRunArgs
(
String
os
,
String
version
)
throws
Exception
{
void
launchWithMultipleRunArgs
(
String
os
,
String
version
)
throws
Exception
{
doLaunch
(
os
,
version
,
"launch-with-multiple-run-args.sh"
);
}
@ParameterizedTest
(
name
=
"{0} {1}"
)
@MethodSource
(
"parameters"
)
public
void
launchWithSingleJavaOpt
(
String
os
,
String
version
)
throws
Exception
{
void
launchWithSingleJavaOpt
(
String
os
,
String
version
)
throws
Exception
{
doLaunch
(
os
,
version
,
"launch-with-single-java-opt.sh"
);
}
@ParameterizedTest
(
name
=
"{0} {1}"
)
@MethodSource
(
"parameters"
)
public
void
launchWithDoubleLinkSingleJavaOpt
(
String
os
,
String
version
)
throws
Exception
{
void
launchWithDoubleLinkSingleJavaOpt
(
String
os
,
String
version
)
throws
Exception
{
doLaunch
(
os
,
version
,
"launch-with-double-link-single-java-opt.sh"
);
}
@ParameterizedTest
(
name
=
"{0} {1}"
)
@MethodSource
(
"parameters"
)
public
void
launchWithMultipleJavaOpts
(
String
os
,
String
version
)
throws
Exception
{
void
launchWithMultipleJavaOpts
(
String
os
,
String
version
)
throws
Exception
{
doLaunch
(
os
,
version
,
"launch-with-multiple-java-opts.sh"
);
}
@ParameterizedTest
(
name
=
"{0} {1}"
)
@MethodSource
(
"parameters"
)
public
void
launchWithUseOfStartStopDaemonDisabled
(
String
os
,
String
version
)
throws
Exception
{
void
launchWithUseOfStartStopDaemonDisabled
(
String
os
,
String
version
)
throws
Exception
{
// CentOS doesn't have start-stop-daemon
Assumptions
.
assumeFalse
(
os
.
equals
(
"CentOS"
));
doLaunch
(
os
,
version
,
"launch-with-use-of-start-stop-daemon-disabled.sh"
);
...
...
@@ -218,7 +218,7 @@ public class SysVinitLaunchScriptIT {
@ParameterizedTest
(
name
=
"{0} {1}"
)
@MethodSource
(
"parameters"
)
public
void
launchWithRelativePidFolder
(
String
os
,
String
version
)
throws
Exception
{
void
launchWithRelativePidFolder
(
String
os
,
String
version
)
throws
Exception
{
String
output
=
doTest
(
os
,
version
,
"launch-with-relative-pid-folder.sh"
);
assertThat
(
output
).
has
(
coloredString
(
AnsiColor
.
GREEN
,
"Started ["
+
extractPid
(
output
)
+
"]"
));
assertThat
(
output
).
has
(
coloredString
(
AnsiColor
.
GREEN
,
"Running ["
+
extractPid
(
output
)
+
"]"
));
...
...
@@ -227,56 +227,56 @@ public class SysVinitLaunchScriptIT {
@ParameterizedTest
(
name
=
"{0} {1}"
)
@MethodSource
(
"parameters"
)
public
void
pidFolderOwnership
(
String
os
,
String
version
)
throws
Exception
{
void
pidFolderOwnership
(
String
os
,
String
version
)
throws
Exception
{
String
output
=
doTest
(
os
,
version
,
"pid-folder-ownership.sh"
);
assertThat
(
output
).
contains
(
"phil root"
);
}
@ParameterizedTest
(
name
=
"{0} {1}"
)
@MethodSource
(
"parameters"
)
public
void
pidFileOwnership
(
String
os
,
String
version
)
throws
Exception
{
void
pidFileOwnership
(
String
os
,
String
version
)
throws
Exception
{
String
output
=
doTest
(
os
,
version
,
"pid-file-ownership.sh"
);
assertThat
(
output
).
contains
(
"phil root"
);
}
@ParameterizedTest
(
name
=
"{0} {1}"
)
@MethodSource
(
"parameters"
)
public
void
logFileOwnership
(
String
os
,
String
version
)
throws
Exception
{
void
logFileOwnership
(
String
os
,
String
version
)
throws
Exception
{
String
output
=
doTest
(
os
,
version
,
"log-file-ownership.sh"
);
assertThat
(
output
).
contains
(
"phil root"
);
}
@ParameterizedTest
(
name
=
"{0} {1}"
)
@MethodSource
(
"parameters"
)
public
void
logFileOwnershipIsChangedWhenCreated
(
String
os
,
String
version
)
throws
Exception
{
void
logFileOwnershipIsChangedWhenCreated
(
String
os
,
String
version
)
throws
Exception
{
String
output
=
doTest
(
os
,
version
,
"log-file-ownership-is-changed-when-created.sh"
);
assertThat
(
output
).
contains
(
"andy root"
);
}
@ParameterizedTest
(
name
=
"{0} {1}"
)
@MethodSource
(
"parameters"
)
public
void
logFileOwnershipIsUnchangedWhenExists
(
String
os
,
String
version
)
throws
Exception
{
void
logFileOwnershipIsUnchangedWhenExists
(
String
os
,
String
version
)
throws
Exception
{
String
output
=
doTest
(
os
,
version
,
"log-file-ownership-is-unchanged-when-exists.sh"
);
assertThat
(
output
).
contains
(
"root root"
);
}
@ParameterizedTest
(
name
=
"{0} {1}"
)
@MethodSource
(
"parameters"
)
public
void
launchWithRelativeLogFolder
(
String
os
,
String
version
)
throws
Exception
{
void
launchWithRelativeLogFolder
(
String
os
,
String
version
)
throws
Exception
{
String
output
=
doTest
(
os
,
version
,
"launch-with-relative-log-folder.sh"
);
assertThat
(
output
).
contains
(
"Log written"
);
}
@ParameterizedTest
(
name
=
"{0} {1}"
)
@MethodSource
(
"parameters"
)
public
void
launchWithRunAsUser
(
String
os
,
String
version
)
throws
Exception
{
void
launchWithRunAsUser
(
String
os
,
String
version
)
throws
Exception
{
String
output
=
doTest
(
os
,
version
,
"launch-with-run-as-user.sh"
);
assertThat
(
output
).
contains
(
"wagner root"
);
}
@ParameterizedTest
(
name
=
"{0} {1}"
)
@MethodSource
(
"parameters"
)
public
void
whenRunAsUserDoesNotExistLaunchFailsWithInvalidArgument
(
String
os
,
String
version
)
throws
Exception
{
void
whenRunAsUserDoesNotExistLaunchFailsWithInvalidArgument
(
String
os
,
String
version
)
throws
Exception
{
String
output
=
doTest
(
os
,
version
,
"launch-with-run-as-invalid-user.sh"
);
assertThat
(
output
).
contains
(
"Status: 2"
);
assertThat
(
output
).
has
(
coloredString
(
AnsiColor
.
RED
,
"Cannot run as 'johndoe': no such user"
));
...
...
@@ -284,15 +284,14 @@ public class SysVinitLaunchScriptIT {
@ParameterizedTest
(
name
=
"{0} {1}"
)
@MethodSource
(
"parameters"
)
public
void
whenJarOwnerAndRunAsUserAreBothSpecifiedRunAsUserTakesPrecedence
(
String
os
,
String
version
)
throws
Exception
{
void
whenJarOwnerAndRunAsUserAreBothSpecifiedRunAsUserTakesPrecedence
(
String
os
,
String
version
)
throws
Exception
{
String
output
=
doTest
(
os
,
version
,
"launch-with-run-as-user-preferred-to-jar-owner.sh"
);
assertThat
(
output
).
contains
(
"wagner root"
);
}
@ParameterizedTest
(
name
=
"{0} {1}"
)
@MethodSource
(
"parameters"
)
public
void
whenLaunchedUsingNonRootUserWithRunAsUserSpecifiedLaunchFailsWithInsufficientPrivilege
(
String
os
,
void
whenLaunchedUsingNonRootUserWithRunAsUserSpecifiedLaunchFailsWithInsufficientPrivilege
(
String
os
,
String
version
)
throws
Exception
{
String
output
=
doTest
(
os
,
version
,
"launch-with-run-as-user-root-required.sh"
);
assertThat
(
output
).
contains
(
"Status: 4"
);
...
...
spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/EmbeddedServletContainerJarDevelopmentIntegrationTests.java
View file @
ded476b5
...
...
@@ -34,18 +34,17 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@EmbeddedServletContainerTest
(
packaging
=
"jar"
,
launchers
=
{
BootRunApplicationLauncher
.
class
,
IdeApplicationLauncher
.
class
})
public
class
EmbeddedServletContainerJarDevelopmentIntegrationTests
{
class
EmbeddedServletContainerJarDevelopmentIntegrationTests
{
@TestTemplate
public
void
metaInfResourceFromDependencyIsAvailableViaHttp
(
RestTemplate
rest
)
{
void
metaInfResourceFromDependencyIsAvailableViaHttp
(
RestTemplate
rest
)
{
ResponseEntity
<
String
>
entity
=
rest
.
getForEntity
(
"/nested-meta-inf-resource.txt"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
}
@TestTemplate
@DisabledOnOs
(
OS
.
WINDOWS
)
public
void
metaInfResourceFromDependencyWithNameThatContainsReservedCharactersIsAvailableViaHttp
(
RestTemplate
rest
)
{
void
metaInfResourceFromDependencyWithNameThatContainsReservedCharactersIsAvailableViaHttp
(
RestTemplate
rest
)
{
ResponseEntity
<
String
>
entity
=
rest
.
getForEntity
(
"/nested-reserved-%21%23%24%25%26%28%29%2A%2B%2C%3A%3D%3F%40%5B%5D-meta-inf-resource.txt"
,
String
.
class
);
...
...
@@ -54,7 +53,7 @@ public class EmbeddedServletContainerJarDevelopmentIntegrationTests {
}
@TestTemplate
public
void
metaInfResourceFromDependencyIsAvailableViaServletContext
(
RestTemplate
rest
)
{
void
metaInfResourceFromDependencyIsAvailableViaServletContext
(
RestTemplate
rest
)
{
ResponseEntity
<
String
>
entity
=
rest
.
getForEntity
(
"/servletContext?/nested-meta-inf-resource.txt"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
...
...
spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/EmbeddedServletContainerJarPackagingIntegrationTests.java
View file @
ded476b5
...
...
@@ -34,17 +34,17 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@EmbeddedServletContainerTest
(
packaging
=
"jar"
,
launchers
=
{
PackagedApplicationLauncher
.
class
,
ExplodedApplicationLauncher
.
class
})
public
class
EmbeddedServletContainerJarPackagingIntegrationTests
{
class
EmbeddedServletContainerJarPackagingIntegrationTests
{
@TestTemplate
public
void
nestedMetaInfResourceIsAvailableViaHttp
(
RestTemplate
rest
)
{
void
nestedMetaInfResourceIsAvailableViaHttp
(
RestTemplate
rest
)
{
ResponseEntity
<
String
>
entity
=
rest
.
getForEntity
(
"/nested-meta-inf-resource.txt"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
}
@TestTemplate
@DisabledOnOs
(
OS
.
WINDOWS
)
public
void
nestedMetaInfResourceWithNameThatContainsReservedCharactersIsAvailableViaHttp
(
RestTemplate
rest
)
{
void
nestedMetaInfResourceWithNameThatContainsReservedCharactersIsAvailableViaHttp
(
RestTemplate
rest
)
{
ResponseEntity
<
String
>
entity
=
rest
.
getForEntity
(
"/nested-reserved-%21%23%24%25%26%28%29%2A%2B%2C%3A%3D%3F%40%5B%5D-meta-inf-resource.txt"
,
String
.
class
);
...
...
@@ -53,27 +53,27 @@ public class EmbeddedServletContainerJarPackagingIntegrationTests {
}
@TestTemplate
public
void
nestedMetaInfResourceIsAvailableViaServletContext
(
RestTemplate
rest
)
{
void
nestedMetaInfResourceIsAvailableViaServletContext
(
RestTemplate
rest
)
{
ResponseEntity
<
String
>
entity
=
rest
.
getForEntity
(
"/servletContext?/nested-meta-inf-resource.txt"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
}
@TestTemplate
public
void
nestedJarIsNotAvailableViaHttp
(
RestTemplate
rest
)
{
void
nestedJarIsNotAvailableViaHttp
(
RestTemplate
rest
)
{
ResponseEntity
<
String
>
entity
=
rest
.
getForEntity
(
"/BOOT-INF/lib/resources-1.0.jar"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
NOT_FOUND
);
}
@TestTemplate
public
void
applicationClassesAreNotAvailableViaHttp
(
RestTemplate
rest
)
{
void
applicationClassesAreNotAvailableViaHttp
(
RestTemplate
rest
)
{
ResponseEntity
<
String
>
entity
=
rest
.
getForEntity
(
"/BOOT-INF/classes/com/example/ResourceHandlingApplication.class"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
NOT_FOUND
);
}
@TestTemplate
public
void
launcherIsNotAvailableViaHttp
(
RestTemplate
rest
)
{
void
launcherIsNotAvailableViaHttp
(
RestTemplate
rest
)
{
ResponseEntity
<
String
>
entity
=
rest
.
getForEntity
(
"/org/springframework/boot/loader/Launcher.class"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
NOT_FOUND
);
...
...
spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/EmbeddedServletContainerWarDevelopmentIntegrationTests.java
View file @
ded476b5
...
...
@@ -41,18 +41,17 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@EmbeddedServletContainerTest
(
packaging
=
"war"
,
launchers
=
{
BootRunApplicationLauncher
.
class
,
IdeApplicationLauncher
.
class
})
public
class
EmbeddedServletContainerWarDevelopmentIntegrationTests
{
class
EmbeddedServletContainerWarDevelopmentIntegrationTests
{
@TestTemplate
public
void
metaInfResourceFromDependencyIsAvailableViaHttp
(
RestTemplate
rest
)
{
void
metaInfResourceFromDependencyIsAvailableViaHttp
(
RestTemplate
rest
)
{
ResponseEntity
<
String
>
entity
=
rest
.
getForEntity
(
"/nested-meta-inf-resource.txt"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
}
@TestTemplate
@DisabledOnOs
(
OS
.
WINDOWS
)
public
void
metaInfResourceFromDependencyWithNameThatContainsReservedCharactersIsAvailableViaHttp
(
RestTemplate
rest
)
{
void
metaInfResourceFromDependencyWithNameThatContainsReservedCharactersIsAvailableViaHttp
(
RestTemplate
rest
)
{
ResponseEntity
<
String
>
entity
=
rest
.
getForEntity
(
"/nested-reserved-%21%23%24%25%26%28%29%2A%2B%2C%3A%3D%3F%40%5B%5D-meta-inf-resource.txt"
,
String
.
class
);
...
...
@@ -61,20 +60,20 @@ public class EmbeddedServletContainerWarDevelopmentIntegrationTests {
}
@TestTemplate
public
void
metaInfResourceFromDependencyIsAvailableViaServletContext
(
RestTemplate
rest
)
{
void
metaInfResourceFromDependencyIsAvailableViaServletContext
(
RestTemplate
rest
)
{
ResponseEntity
<
String
>
entity
=
rest
.
getForEntity
(
"/servletContext?/nested-meta-inf-resource.txt"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
}
@TestTemplate
public
void
webappResourcesAreAvailableViaHttp
(
RestTemplate
rest
)
{
void
webappResourcesAreAvailableViaHttp
(
RestTemplate
rest
)
{
ResponseEntity
<
String
>
entity
=
rest
.
getForEntity
(
"/webapp-resource.txt"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
}
@TestTemplate
public
void
loaderClassesAreNotAvailableViaResourcePaths
(
RestTemplate
rest
)
{
void
loaderClassesAreNotAvailableViaResourcePaths
(
RestTemplate
rest
)
{
ResponseEntity
<
String
>
entity
=
rest
.
getForEntity
(
"/resourcePaths"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
assertThat
(
readLines
(
entity
.
getBody
()))
...
...
spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/EmbeddedServletContainerWarPackagingIntegrationTests.java
View file @
ded476b5
...
...
@@ -41,17 +41,17 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@EmbeddedServletContainerTest
(
packaging
=
"war"
,
launchers
=
{
PackagedApplicationLauncher
.
class
,
ExplodedApplicationLauncher
.
class
})
public
class
EmbeddedServletContainerWarPackagingIntegrationTests
{
class
EmbeddedServletContainerWarPackagingIntegrationTests
{
@TestTemplate
public
void
nestedMetaInfResourceIsAvailableViaHttp
(
RestTemplate
rest
)
{
void
nestedMetaInfResourceIsAvailableViaHttp
(
RestTemplate
rest
)
{
ResponseEntity
<
String
>
entity
=
rest
.
getForEntity
(
"/nested-meta-inf-resource.txt"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
}
@TestTemplate
@DisabledOnOs
(
OS
.
WINDOWS
)
public
void
nestedMetaInfResourceWithNameThatContainsReservedCharactersIsAvailableViaHttp
(
RestTemplate
rest
)
{
void
nestedMetaInfResourceWithNameThatContainsReservedCharactersIsAvailableViaHttp
(
RestTemplate
rest
)
{
ResponseEntity
<
String
>
entity
=
rest
.
getForEntity
(
"/nested-reserved-%21%23%24%25%26%28%29%2A%2B%2C%3A%3D%3F%40%5B%5D-meta-inf-resource.txt"
,
String
.
class
);
...
...
@@ -60,33 +60,33 @@ public class EmbeddedServletContainerWarPackagingIntegrationTests {
}
@TestTemplate
public
void
nestedMetaInfResourceIsAvailableViaServletContext
(
RestTemplate
rest
)
{
void
nestedMetaInfResourceIsAvailableViaServletContext
(
RestTemplate
rest
)
{
ResponseEntity
<
String
>
entity
=
rest
.
getForEntity
(
"/servletContext?/nested-meta-inf-resource.txt"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
}
@TestTemplate
public
void
nestedJarIsNotAvailableViaHttp
(
RestTemplate
rest
)
{
void
nestedJarIsNotAvailableViaHttp
(
RestTemplate
rest
)
{
ResponseEntity
<
String
>
entity
=
rest
.
getForEntity
(
"/WEB-INF/lib/resources-1.0.jar"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
NOT_FOUND
);
}
@TestTemplate
public
void
applicationClassesAreNotAvailableViaHttp
(
RestTemplate
rest
)
{
void
applicationClassesAreNotAvailableViaHttp
(
RestTemplate
rest
)
{
ResponseEntity
<
String
>
entity
=
rest
.
getForEntity
(
"/WEB-INF/classes/com/example/ResourceHandlingApplication.class"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
NOT_FOUND
);
}
@TestTemplate
public
void
webappResourcesAreAvailableViaHttp
(
RestTemplate
rest
)
{
void
webappResourcesAreAvailableViaHttp
(
RestTemplate
rest
)
{
ResponseEntity
<
String
>
entity
=
rest
.
getForEntity
(
"/webapp-resource.txt"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
}
@TestTemplate
public
void
loaderClassesAreNotAvailableViaHttp
(
RestTemplate
rest
)
{
void
loaderClassesAreNotAvailableViaHttp
(
RestTemplate
rest
)
{
ResponseEntity
<
String
>
entity
=
rest
.
getForEntity
(
"/org/springframework/boot/loader/Launcher.class"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
NOT_FOUND
);
...
...
@@ -95,7 +95,7 @@ public class EmbeddedServletContainerWarPackagingIntegrationTests {
}
@TestTemplate
public
void
loaderClassesAreNotAvailableViaResourcePaths
(
RestTemplate
rest
)
{
void
loaderClassesAreNotAvailableViaResourcePaths
(
RestTemplate
rest
)
{
ResponseEntity
<
String
>
entity
=
rest
.
getForEntity
(
"/resourcePaths"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
assertThat
(
readLines
(
entity
.
getBody
()))
...
...
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