aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBelen Pruvost <belen.pruvost@sonarsource.com>2021-11-25 15:57:57 +0100
committersonartech <sonartech@sonarsource.com>2021-11-25 20:03:17 +0000
commitf4aa4a1a4e3c03df20061c4ddded70105f23a116 (patch)
tree0be6b469b20fa0977982171839a3740fc5840a10
parentc2077e970a1e9c136cbc80743b23167c657b6f6b (diff)
downloadsonarqube-f4aa4a1a4e3c03df20061c4ddded70105f23a116.tar.gz
sonarqube-f4aa4a1a4e3c03df20061c4ddded70105f23a116.zip
[NO-JIRA] Fix Validate Task
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/utils/command/CommandExecutorTest.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/utils/command/CommandExecutorTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/utils/command/CommandExecutorTest.java
index f72b3b77ba6..4396d5fe853 100644
--- a/sonar-plugin-api/src/test/java/org/sonar/api/utils/command/CommandExecutorTest.java
+++ b/sonar-plugin-api/src/test/java/org/sonar/api/utils/command/CommandExecutorTest.java
@@ -124,13 +124,14 @@ public class CommandExecutorTest {
@Test(timeout = 6000L)
public void should_stop_after_timeout_and_new_shell() throws IOException {
- try {
- String executable = getScript("forever");
+ String executable = getScript("forever");
+
+ assertThatThrownBy(() -> {
CommandExecutor.create().execute(Command.create(executable).setNewShell(true).setDirectory(workDir), 100);
fail();
- } catch (TimeoutException e) {
- // ok
- }
+
+ })
+ .isInstanceOf(TimeoutException.class);
}
@Test