Skip to content

Commit a1cf607

Browse files
committed
Adjust automated tests for security fix
One of the tests was asserting that the security issue exists. Nice because that means that there is automated testing for at least one of the changes for security.
1 parent f8428f8 commit a1cf607

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/test/java/jp/ikedam/jenkins/plugins/extensible_choice_parameter/SystemGroovyChoiceListProviderJenkinsTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ void testDescriptor_doFillDefaultChoiceItemsWithoutPermission() throws Exception
223223
descriptor.getDescriptorUrl() + "/fillDefaultChoiceItems/?script=" + properScript + "&sandbox=" + true
224224
+ "&usePredefinedVariables=" + false,
225225
null);
226-
assertEquals(HttpServletResponse.SC_OK, page.getWebResponse().getStatusCode());
226+
assertEquals(HttpServletResponse.SC_NOT_FOUND, page.getWebResponse().getStatusCode());
227227

228228
// configurer has access to the job but without Item/Configure permission => 403
229229
User configurer = User.getOrCreateByIdOrFullName("configurer");
@@ -234,7 +234,7 @@ void testDescriptor_doFillDefaultChoiceItemsWithoutPermission() throws Exception
234234
p.getUrl() + descriptor.getDescriptorUrl() + "/fillDefaultChoiceItems/?script=" + properScript
235235
+ "&sandbox=" + true + "&usePredefinedVariables=" + false,
236236
null);
237-
assertEquals(HttpServletResponse.SC_FORBIDDEN, page.getWebResponse().getStatusCode());
237+
assertEquals(HttpServletResponse.SC_NOT_FOUND, page.getWebResponse().getStatusCode());
238238
}
239239

240240
@Test
@@ -326,7 +326,7 @@ void testDescriptor_doTestWithoutPermission() throws Exception {
326326
descriptor.getDescriptorUrl() + "/test/?script=" + properScript + "&sandbox=" + true
327327
+ "&usePredefinedVariables=" + false,
328328
null);
329-
assertEquals(HttpServletResponse.SC_OK, page.getWebResponse().getStatusCode());
329+
assertEquals(HttpServletResponse.SC_NOT_FOUND, page.getWebResponse().getStatusCode());
330330

331331
// configurer has access to the job but without Item/Configure permission => 403
332332
User configurer = User.getOrCreateByIdOrFullName("configurer");
@@ -337,7 +337,7 @@ void testDescriptor_doTestWithoutPermission() throws Exception {
337337
p,
338338
descriptor.getDescriptorUrl() + "/test/?script=" + properScript + "&sandbox=" + true
339339
+ "&usePredefinedVariables=" + false);
340-
assertEquals(HttpServletResponse.SC_FORBIDDEN, page.getWebResponse().getStatusCode());
340+
assertEquals(HttpServletResponse.SC_NOT_FOUND, page.getWebResponse().getStatusCode());
341341
}
342342

343343
@Test

0 commit comments

Comments
 (0)