Skip to content

Commit 6c1b5e3

Browse files
committed
Add login step for user in testAgentSecretWithoutAgentConnectPermission
Ensures the web client logs in as userWithoutConnect before attempting to access the agent-secret endpoint.
1 parent 05a54bc commit 6c1b5e3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/src/test/java/hudson/slaves/SlaveComputerTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,8 @@ void testAgentSecretWithoutAgentConnectPermission() throws Exception {
271271
j.jenkins.setAuthorizationStrategy(authStrategy);
272272

273273
JenkinsRule.WebClient wc = j.createWebClient();
274+
wc.login(userWithoutConnect);
275+
274276
// Expect 403 Forbidden
275277
FailingHttpStatusCodeException e = assertThrows(FailingHttpStatusCodeException.class, () -> {
276278
wc.goTo("computer/" + testAgent.getNodeName() + "/agent-secret", "text/plain");

0 commit comments

Comments
 (0)