aboutsummaryrefslogtreecommitdiffstats
path: root/tools/simple-wsclient
diff options
context:
space:
mode:
authoradheli.tavares <adheli.tavares@est.tech>2024-06-11 15:49:30 +0100
committeradheli.tavares <adheli.tavares@est.tech>2024-06-17 16:12:00 +0100
commitdd15704b23b3b1e9508a5f615f066ffca46a7101 (patch)
treec3a1158fc288223fcb4173765e71637d844a3501 /tools/simple-wsclient
parente9b746340711ddfccee7ac0f669ace626b1b3d46 (diff)
Convert junit4 to junit5
- tools module Issue-ID: POLICY-5041 Change-Id: I4fddc20e306e82db8af858ff2444f7e40c9e5acd Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
Diffstat (limited to 'tools/simple-wsclient')
-rw-r--r--tools/simple-wsclient/src/test/java/org/onap/policy/apex/tools/simple/wsclient/WsClientTest.java35
1 files changed, 18 insertions, 17 deletions
diff --git a/tools/simple-wsclient/src/test/java/org/onap/policy/apex/tools/simple/wsclient/WsClientTest.java b/tools/simple-wsclient/src/test/java/org/onap/policy/apex/tools/simple/wsclient/WsClientTest.java
index e3e775af4..2c618c6a7 100644
--- a/tools/simple-wsclient/src/test/java/org/onap/policy/apex/tools/simple/wsclient/WsClientTest.java
+++ b/tools/simple-wsclient/src/test/java/org/onap/policy/apex/tools/simple/wsclient/WsClientTest.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
- * Modifications Copyright (C) 2020 Nordix Foundation
+ * Modifications Copyright (C) 2020, 2024 Nordix Foundation.
* Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -29,70 +29,71 @@ import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.PrintStream;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
/**
* Test the WsClient utility.
*/
-public class WsClientTest {
+class WsClientTest {
+
@Test
- public void testWsClient() {
+ void testWsClient() {
final String[] EventArgs =
- { "-h" };
+ {"-h"};
assertThatCode(() -> WsClientMain.main(EventArgs)).doesNotThrowAnyException();
}
@Test
- public void testWsClientNoOptions() {
+ void testWsClientNoOptions() {
assertThat(runWsClient(new String[] {})).contains("ws-client: starting simple event echo");
}
@Test
- public void testWsClientBadOptions() {
+ void testWsClientBadOptions() {
assertThat(runWsClient(new String[] {"-zabbu"})).contains("usage: ws-client");
}
@Test
- public void testWsClientHelp() {
+ void testWsClientHelp() {
assertThat(runWsClient(new String[] {"-h"})).contains("usage: ws-client");
}
@Test
- public void testWsClientVersion() {
+ void testWsClientVersion() {
assertThat(runWsClient(new String[] {"-v"})).contains("ws-client").doesNotContain("usage:");
}
@Test
- public void testWsClientNoServerArg() {
+ void testWsClientNoServerArg() {
assertThat(runWsClient(new String[] {"-s"})).contains("ws-client");
}
@Test
- public void testWsClientNoPortArg() {
+ void testWsClientNoPortArg() {
assertThat(runWsClient(new String[] {"-p"})).contains("usage: ws-client");
}
@Test
- public void testWsClientBadPortArg() {
+ void testWsClientBadPortArg() {
assertThat(runWsClient(new String[] {"-p", "hello"})).contains("ws-client");
}
@Test
- public void testWsClientBadServerArg() {
+ void testWsClientBadServerArg() {
assertThat(runWsClient(new String[] {"-s", "asdsadadasd:asdasdsadasd"})).contains("ws-client");
}
@Test
- public void testWsClientConsole() {
+ void testWsClientConsole() {
assertThat(runWsClient(new String[] {"-c", "-s", "AServerThatDoesntExist", "-p", "99999999"}))
- .contains("terminate the application typing");
+ .contains("terminate the application typing");
}
@Test
- public void testWsClientEcho() {
+ void testWsClientEcho() {
assertThat(runWsClient(new String[] {"-s", "AServerThatDoesntExist", "-p", "99999999"})).contains(
- "Once started, the application will simply print out all received events to standard out");
+ "Once started, the application will simply print out all received events to standard out");
}
/**