6161 * @author Andy Wilkinson
6262 * @author Ali Shahbour
6363 */
64- public class SysVinitLaunchScriptIT {
64+ class SysVinitLaunchScriptIT {
6565
6666 private final SpringBootDockerCmdExecFactory commandExecFactory = new SpringBootDockerCmdExecFactory ();
6767
6868 private static final char ESC = 27 ;
6969
7070 @ ParameterizedTest (name = "{0} {1}" )
7171 @ MethodSource ("parameters" )
72- public void statusWhenStopped (String os , String version ) throws Exception {
72+ void statusWhenStopped (String os , String version ) throws Exception {
7373 String output = doTest (os , version , "status-when-stopped.sh" );
7474 assertThat (output ).contains ("Status: 3" );
7575 assertThat (output ).has (coloredString (AnsiColor .RED , "Not running" ));
7676 }
7777
7878 @ ParameterizedTest (name = "{0} {1}" )
7979 @ MethodSource ("parameters" )
80- public void statusWhenStarted (String os , String version ) throws Exception {
80+ void statusWhenStarted (String os , String version ) throws Exception {
8181 String output = doTest (os , version , "status-when-started.sh" );
8282 assertThat (output ).contains ("Status: 0" );
8383 assertThat (output ).has (coloredString (AnsiColor .GREEN , "Started [" + extractPid (output ) + "]" ));
8484 }
8585
8686 @ ParameterizedTest (name = "{0} {1}" )
8787 @ MethodSource ("parameters" )
88- public void statusWhenKilled (String os , String version ) throws Exception {
88+ void statusWhenKilled (String os , String version ) throws Exception {
8989 String output = doTest (os , version , "status-when-killed.sh" );
9090 assertThat (output ).contains ("Status: 1" );
9191 assertThat (output )
@@ -94,31 +94,31 @@ public void statusWhenKilled(String os, String version) throws Exception {
9494
9595 @ ParameterizedTest (name = "{0} {1}" )
9696 @ MethodSource ("parameters" )
97- public void stopWhenStopped (String os , String version ) throws Exception {
97+ void stopWhenStopped (String os , String version ) throws Exception {
9898 String output = doTest (os , version , "stop-when-stopped.sh" );
9999 assertThat (output ).contains ("Status: 0" );
100100 assertThat (output ).has (coloredString (AnsiColor .YELLOW , "Not running (pidfile not found)" ));
101101 }
102102
103103 @ ParameterizedTest (name = "{0} {1}" )
104104 @ MethodSource ("parameters" )
105- public void forceStopWhenStopped (String os , String version ) throws Exception {
105+ void forceStopWhenStopped (String os , String version ) throws Exception {
106106 String output = doTest (os , version , "force-stop-when-stopped.sh" );
107107 assertThat (output ).contains ("Status: 0" );
108108 assertThat (output ).has (coloredString (AnsiColor .YELLOW , "Not running (pidfile not found)" ));
109109 }
110110
111111 @ ParameterizedTest (name = "{0} {1}" )
112112 @ MethodSource ("parameters" )
113- public void startWhenStarted (String os , String version ) throws Exception {
113+ void startWhenStarted (String os , String version ) throws Exception {
114114 String output = doTest (os , version , "start-when-started.sh" );
115115 assertThat (output ).contains ("Status: 0" );
116116 assertThat (output ).has (coloredString (AnsiColor .YELLOW , "Already running [" + extractPid (output ) + "]" ));
117117 }
118118
119119 @ ParameterizedTest (name = "{0} {1}" )
120120 @ MethodSource ("parameters" )
121- public void restartWhenStopped (String os , String version ) throws Exception {
121+ void restartWhenStopped (String os , String version ) throws Exception {
122122 String output = doTest (os , version , "restart-when-stopped.sh" );
123123 assertThat (output ).contains ("Status: 0" );
124124 assertThat (output ).has (coloredString (AnsiColor .YELLOW , "Not running (pidfile not found)" ));
@@ -127,7 +127,7 @@ public void restartWhenStopped(String os, String version) throws Exception {
127127
128128 @ ParameterizedTest (name = "{0} {1}" )
129129 @ MethodSource ("parameters" )
130- public void restartWhenStarted (String os , String version ) throws Exception {
130+ void restartWhenStarted (String os , String version ) throws Exception {
131131 String output = doTest (os , version , "restart-when-started.sh" );
132132 assertThat (output ).contains ("Status: 0" );
133133 assertThat (output ).has (coloredString (AnsiColor .GREEN , "Started [" + extract ("PID1" , output ) + "]" ));
@@ -137,88 +137,88 @@ public void restartWhenStarted(String os, String version) throws Exception {
137137
138138 @ ParameterizedTest (name = "{0} {1}" )
139139 @ MethodSource ("parameters" )
140- public void startWhenStopped (String os , String version ) throws Exception {
140+ void startWhenStopped (String os , String version ) throws Exception {
141141 String output = doTest (os , version , "start-when-stopped.sh" );
142142 assertThat (output ).contains ("Status: 0" );
143143 assertThat (output ).has (coloredString (AnsiColor .GREEN , "Started [" + extractPid (output ) + "]" ));
144144 }
145145
146146 @ ParameterizedTest (name = "{0} {1}" )
147147 @ MethodSource ("parameters" )
148- public void basicLaunch (String os , String version ) throws Exception {
148+ void basicLaunch (String os , String version ) throws Exception {
149149 String output = doTest (os , version , "basic-launch.sh" );
150150 assertThat (output ).doesNotContain ("PID_FOLDER" );
151151 }
152152
153153 @ ParameterizedTest (name = "{0} {1}" )
154154 @ MethodSource ("parameters" )
155- public void launchWithMissingLogFolderGeneratesAWarning (String os , String version ) throws Exception {
155+ void launchWithMissingLogFolderGeneratesAWarning (String os , String version ) throws Exception {
156156 String output = doTest (os , version , "launch-with-missing-log-folder.sh" );
157157 assertThat (output ).has (
158158 coloredString (AnsiColor .YELLOW , "LOG_FOLDER /does/not/exist does not exist. Falling back to /tmp" ));
159159 }
160160
161161 @ ParameterizedTest (name = "{0} {1}" )
162162 @ MethodSource ("parameters" )
163- public void launchWithMissingPidFolderGeneratesAWarning (String os , String version ) throws Exception {
163+ void launchWithMissingPidFolderGeneratesAWarning (String os , String version ) throws Exception {
164164 String output = doTest (os , version , "launch-with-missing-pid-folder.sh" );
165165 assertThat (output ).has (
166166 coloredString (AnsiColor .YELLOW , "PID_FOLDER /does/not/exist does not exist. Falling back to /tmp" ));
167167 }
168168
169169 @ ParameterizedTest (name = "{0} {1}" )
170170 @ MethodSource ("parameters" )
171- public void launchWithSingleCommandLineArgument (String os , String version ) throws Exception {
171+ void launchWithSingleCommandLineArgument (String os , String version ) throws Exception {
172172 doLaunch (os , version , "launch-with-single-command-line-argument.sh" );
173173 }
174174
175175 @ ParameterizedTest (name = "{0} {1}" )
176176 @ MethodSource ("parameters" )
177- public void launchWithMultipleCommandLineArguments (String os , String version ) throws Exception {
177+ void launchWithMultipleCommandLineArguments (String os , String version ) throws Exception {
178178 doLaunch (os , version , "launch-with-multiple-command-line-arguments.sh" );
179179 }
180180
181181 @ ParameterizedTest (name = "{0} {1}" )
182182 @ MethodSource ("parameters" )
183- public void launchWithSingleRunArg (String os , String version ) throws Exception {
183+ void launchWithSingleRunArg (String os , String version ) throws Exception {
184184 doLaunch (os , version , "launch-with-single-run-arg.sh" );
185185 }
186186
187187 @ ParameterizedTest (name = "{0} {1}" )
188188 @ MethodSource ("parameters" )
189- public void launchWithMultipleRunArgs (String os , String version ) throws Exception {
189+ void launchWithMultipleRunArgs (String os , String version ) throws Exception {
190190 doLaunch (os , version , "launch-with-multiple-run-args.sh" );
191191 }
192192
193193 @ ParameterizedTest (name = "{0} {1}" )
194194 @ MethodSource ("parameters" )
195- public void launchWithSingleJavaOpt (String os , String version ) throws Exception {
195+ void launchWithSingleJavaOpt (String os , String version ) throws Exception {
196196 doLaunch (os , version , "launch-with-single-java-opt.sh" );
197197 }
198198
199199 @ ParameterizedTest (name = "{0} {1}" )
200200 @ MethodSource ("parameters" )
201- public void launchWithDoubleLinkSingleJavaOpt (String os , String version ) throws Exception {
201+ void launchWithDoubleLinkSingleJavaOpt (String os , String version ) throws Exception {
202202 doLaunch (os , version , "launch-with-double-link-single-java-opt.sh" );
203203 }
204204
205205 @ ParameterizedTest (name = "{0} {1}" )
206206 @ MethodSource ("parameters" )
207- public void launchWithMultipleJavaOpts (String os , String version ) throws Exception {
207+ void launchWithMultipleJavaOpts (String os , String version ) throws Exception {
208208 doLaunch (os , version , "launch-with-multiple-java-opts.sh" );
209209 }
210210
211211 @ ParameterizedTest (name = "{0} {1}" )
212212 @ MethodSource ("parameters" )
213- public void launchWithUseOfStartStopDaemonDisabled (String os , String version ) throws Exception {
213+ void launchWithUseOfStartStopDaemonDisabled (String os , String version ) throws Exception {
214214 // CentOS doesn't have start-stop-daemon
215215 Assumptions .assumeFalse (os .equals ("CentOS" ));
216216 doLaunch (os , version , "launch-with-use-of-start-stop-daemon-disabled.sh" );
217217 }
218218
219219 @ ParameterizedTest (name = "{0} {1}" )
220220 @ MethodSource ("parameters" )
221- public void launchWithRelativePidFolder (String os , String version ) throws Exception {
221+ void launchWithRelativePidFolder (String os , String version ) throws Exception {
222222 String output = doTest (os , version , "launch-with-relative-pid-folder.sh" );
223223 assertThat (output ).has (coloredString (AnsiColor .GREEN , "Started [" + extractPid (output ) + "]" ));
224224 assertThat (output ).has (coloredString (AnsiColor .GREEN , "Running [" + extractPid (output ) + "]" ));
@@ -227,72 +227,71 @@ public void launchWithRelativePidFolder(String os, String version) throws Except
227227
228228 @ ParameterizedTest (name = "{0} {1}" )
229229 @ MethodSource ("parameters" )
230- public void pidFolderOwnership (String os , String version ) throws Exception {
230+ void pidFolderOwnership (String os , String version ) throws Exception {
231231 String output = doTest (os , version , "pid-folder-ownership.sh" );
232232 assertThat (output ).contains ("phil root" );
233233 }
234234
235235 @ ParameterizedTest (name = "{0} {1}" )
236236 @ MethodSource ("parameters" )
237- public void pidFileOwnership (String os , String version ) throws Exception {
237+ void pidFileOwnership (String os , String version ) throws Exception {
238238 String output = doTest (os , version , "pid-file-ownership.sh" );
239239 assertThat (output ).contains ("phil root" );
240240 }
241241
242242 @ ParameterizedTest (name = "{0} {1}" )
243243 @ MethodSource ("parameters" )
244- public void logFileOwnership (String os , String version ) throws Exception {
244+ void logFileOwnership (String os , String version ) throws Exception {
245245 String output = doTest (os , version , "log-file-ownership.sh" );
246246 assertThat (output ).contains ("phil root" );
247247 }
248248
249249 @ ParameterizedTest (name = "{0} {1}" )
250250 @ MethodSource ("parameters" )
251- public void logFileOwnershipIsChangedWhenCreated (String os , String version ) throws Exception {
251+ void logFileOwnershipIsChangedWhenCreated (String os , String version ) throws Exception {
252252 String output = doTest (os , version , "log-file-ownership-is-changed-when-created.sh" );
253253 assertThat (output ).contains ("andy root" );
254254 }
255255
256256 @ ParameterizedTest (name = "{0} {1}" )
257257 @ MethodSource ("parameters" )
258- public void logFileOwnershipIsUnchangedWhenExists (String os , String version ) throws Exception {
258+ void logFileOwnershipIsUnchangedWhenExists (String os , String version ) throws Exception {
259259 String output = doTest (os , version , "log-file-ownership-is-unchanged-when-exists.sh" );
260260 assertThat (output ).contains ("root root" );
261261 }
262262
263263 @ ParameterizedTest (name = "{0} {1}" )
264264 @ MethodSource ("parameters" )
265- public void launchWithRelativeLogFolder (String os , String version ) throws Exception {
265+ void launchWithRelativeLogFolder (String os , String version ) throws Exception {
266266 String output = doTest (os , version , "launch-with-relative-log-folder.sh" );
267267 assertThat (output ).contains ("Log written" );
268268 }
269269
270270 @ ParameterizedTest (name = "{0} {1}" )
271271 @ MethodSource ("parameters" )
272- public void launchWithRunAsUser (String os , String version ) throws Exception {
272+ void launchWithRunAsUser (String os , String version ) throws Exception {
273273 String output = doTest (os , version , "launch-with-run-as-user.sh" );
274274 assertThat (output ).contains ("wagner root" );
275275 }
276276
277277 @ ParameterizedTest (name = "{0} {1}" )
278278 @ MethodSource ("parameters" )
279- public void whenRunAsUserDoesNotExistLaunchFailsWithInvalidArgument (String os , String version ) throws Exception {
279+ void whenRunAsUserDoesNotExistLaunchFailsWithInvalidArgument (String os , String version ) throws Exception {
280280 String output = doTest (os , version , "launch-with-run-as-invalid-user.sh" );
281281 assertThat (output ).contains ("Status: 2" );
282282 assertThat (output ).has (coloredString (AnsiColor .RED , "Cannot run as 'johndoe': no such user" ));
283283 }
284284
285285 @ ParameterizedTest (name = "{0} {1}" )
286286 @ MethodSource ("parameters" )
287- public void whenJarOwnerAndRunAsUserAreBothSpecifiedRunAsUserTakesPrecedence (String os , String version )
288- throws Exception {
287+ void whenJarOwnerAndRunAsUserAreBothSpecifiedRunAsUserTakesPrecedence (String os , String version ) throws Exception {
289288 String output = doTest (os , version , "launch-with-run-as-user-preferred-to-jar-owner.sh" );
290289 assertThat (output ).contains ("wagner root" );
291290 }
292291
293292 @ ParameterizedTest (name = "{0} {1}" )
294293 @ MethodSource ("parameters" )
295- public void whenLaunchedUsingNonRootUserWithRunAsUserSpecifiedLaunchFailsWithInsufficientPrivilege (String os ,
294+ void whenLaunchedUsingNonRootUserWithRunAsUserSpecifiedLaunchFailsWithInsufficientPrivilege (String os ,
296295 String version ) throws Exception {
297296 String output = doTest (os , version , "launch-with-run-as-user-root-required.sh" );
298297 assertThat (output ).contains ("Status: 4" );
0 commit comments