aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/test/java/org/onap/policy/distribution/main/startstop/TestDistributionCommandLineArguments.java
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/test/java/org/onap/policy/distribution/main/startstop/TestDistributionCommandLineArguments.java')
-rw-r--r--main/src/test/java/org/onap/policy/distribution/main/startstop/TestDistributionCommandLineArguments.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/main/src/test/java/org/onap/policy/distribution/main/startstop/TestDistributionCommandLineArguments.java b/main/src/test/java/org/onap/policy/distribution/main/startstop/TestDistributionCommandLineArguments.java
index 0a0e5fa0..09ab1314 100644
--- a/main/src/test/java/org/onap/policy/distribution/main/startstop/TestDistributionCommandLineArguments.java
+++ b/main/src/test/java/org/onap/policy/distribution/main/startstop/TestDistributionCommandLineArguments.java
@@ -24,7 +24,7 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.Assert.assertThrows;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.distribution.main.PolicyDistributionRuntimeException;
/**
@@ -33,49 +33,49 @@ import org.onap.policy.distribution.main.PolicyDistributionRuntimeException;
* @author Adheli Tavares (adheli.tavares@est.tech)
*
*/
-public class TestDistributionCommandLineArguments {
+class TestDistributionCommandLineArguments {
@Test
- public void testDistributionOnlyFileName() {
+ void testDistributionOnlyFileName() {
String[] testArgs = {"src/test/resources/parameters/DistributionConfigParameters.json"};
assertThrows(PolicyDistributionRuntimeException.class, () -> new DistributionCommandLineArguments(testArgs));
}
@Test
- public void testDistributionCommandLineArgumentsException() {
+ void testDistributionCommandLineArgumentsException() {
String[] wrongParams = {"arg1", "nothing", "{\"someJson\":1}"};
assertThrows(PolicyDistributionRuntimeException.class, () -> new DistributionCommandLineArguments(wrongParams));
}
@Test
- public void testValidateFileNameEmpty() {
+ void testValidateFileNameEmpty() {
String[] argsOnlyKeyNoValue = {"-c", ""};
assertValidate(argsOnlyKeyNoValue, "policy-distribution configuration file was not specified as an argument");
}
@Test
- public void testValidateFileNameDoesNotExist() {
+ void testValidateFileNameDoesNotExist() {
String[] fileNameNotExistentArgs = {"-c", "someFileName.json"};
assertValidate(fileNameNotExistentArgs,
"policy-distribution configuration file \"someFileName.json\" does not exist");
}
@Test
- public void testValidateFileNameIsNotFile() {
+ void testValidateFileNameIsNotFile() {
String[] folderAsFileNameArgs = {"-c", "src/test/resources/parameters"};
assertValidate(folderAsFileNameArgs,
"policy-distribution configuration file \"src/test/resources/parameters\" is not a normal file");
}
@Test
- public void testDistributionVersion() {
+ void testDistributionVersion() {
String[] testArgs = {"-v"};
- DistributionCommandLineArguments sutArgs = new DistributionCommandLineArguments(testArgs);
+ var sutArgs = new DistributionCommandLineArguments(testArgs);
assertThat(sutArgs.version()).startsWith("ONAP Policy Framework Distribution Service");
}
private void assertValidate(String[] testArgs, String expectedErrorMsg) {
- DistributionCommandLineArguments sutArgs = new DistributionCommandLineArguments(testArgs);
- assertThatThrownBy(() -> sutArgs.validate()).hasMessage(expectedErrorMsg);
+ var sutArgs = new DistributionCommandLineArguments(testArgs);
+ assertThatThrownBy(sutArgs::validate).hasMessage(expectedErrorMsg);
}
}