From 48f216e98944ee6b2404ad2040f26ea5de265b5f Mon Sep 17 00:00:00 2001 From: Ivan Fernandez Calvo Date: Fri, 20 Dec 2024 19:36:36 +0100 Subject: [PATCH] fix: remove old code fro PCT (#543) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../sshslaves/verifiers/TrustHostKeyActionTest.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/test/java/hudson/plugins/sshslaves/verifiers/TrustHostKeyActionTest.java b/src/test/java/hudson/plugins/sshslaves/verifiers/TrustHostKeyActionTest.java index 737ea398..db6201c1 100644 --- a/src/test/java/hudson/plugins/sshslaves/verifiers/TrustHostKeyActionTest.java +++ b/src/test/java/hudson/plugins/sshslaves/verifiers/TrustHostKeyActionTest.java @@ -26,6 +26,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertThrows; import static org.junit.Assert.assertTrue; import java.io.IOException; @@ -111,15 +112,7 @@ public void testSubmitNotAuthorised() throws Exception { jenkins.getInstance().addNode(agent); SlaveComputer computer = (SlaveComputer) jenkins.getInstance().getComputer("test-agent"); - - try { - computer.connect(false).get(); - } catch (ExecutionException ex){ - //TODO(oleg_nenashev): "Slave" check is still needed for PCT purposes, but it should be eventually cleaned up - if (!ex.getMessage().startsWith("java.io.IOException: Slave failed") && !ex.getMessage().startsWith("java.io.IOException: Agent failed")) { - throw ex; - } - } + assertThrows(ExecutionException.class, () -> computer.connect(false).get()); List actions = computer.getActions(TrustHostKeyAction.class); assertEquals(computer.getLog(), 1, actions.size());