The change to sonar cloud resulted in new issues being uncovered.
Addressed two of the three issues with this:
Remove this unused import...
Add at least one assertion to this test case.
The item left outstanding is:
Make sure that command line arguments are used safely here.
Issue-ID: POLICY-2206
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: Ie5dc339640102a5b4471e5b719338358ec3e0209
Signed-off-by: Jim Hahn <jrh3@att.com>
package org.onap.policy.api.main.parameters;
-import java.util.ArrayList;
import java.util.List;
import org.onap.policy.common.endpoints.parameters.RestServerParameters;
import org.onap.policy.common.parameters.GroupValidationResult;
package org.onap.policy.api.main.startstop;
+import static org.assertj.core.api.Assertions.assertThatCode;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@Test
public void testMain_Help() {
final String[] apiConfigParameters = { "-h" };
- Main.main(apiConfigParameters);
+ assertThatCode(() -> Main.main(apiConfigParameters)).doesNotThrowAnyException();
}
@Test