aboutsummaryrefslogtreecommitdiffstats
path: root/examples/examples-myfirstpolicy/src/test/java/org
diff options
context:
space:
mode:
authorJvD_Ericsson <jeff.van.dam@est.tech>2020-07-08 13:21:57 +0100
committerJvD_Ericsson <jeff.van.dam@est.tech>2020-07-13 08:53:28 +0100
commitaa987aab348f13d477c6cf32e61689d396ebfba5 (patch)
tree3899017a20693b275d62f7e944393fb64f37d654 /examples/examples-myfirstpolicy/src/test/java/org
parent871421fb99f7e6221b2c084e43a9388f618f882d (diff)
Fix assertTrue SONAR issues in apex-pdp/examples and apex-pdp/model
Replace assertTrue with assertEquals and assertFalse with assertNotEquals in apex-pdp/examples and apex-pdp/model Issue-ID: POLICY-2690 Change-Id: Ie863dd95ccead62268689a4a8388f9b6e8821649 Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech>
Diffstat (limited to 'examples/examples-myfirstpolicy/src/test/java/org')
-rw-r--r--examples/examples-myfirstpolicy/src/test/java/org/onap/policy/apex/examples/myfirstpolicy/MfpUseCaseTest.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/examples/examples-myfirstpolicy/src/test/java/org/onap/policy/apex/examples/myfirstpolicy/MfpUseCaseTest.java b/examples/examples-myfirstpolicy/src/test/java/org/onap/policy/apex/examples/myfirstpolicy/MfpUseCaseTest.java
index c495bd32b..8afe7d7cd 100644
--- a/examples/examples-myfirstpolicy/src/test/java/org/onap/policy/apex/examples/myfirstpolicy/MfpUseCaseTest.java
+++ b/examples/examples-myfirstpolicy/src/test/java/org/onap/policy/apex/examples/myfirstpolicy/MfpUseCaseTest.java
@@ -308,12 +308,12 @@ public class MfpUseCaseTest {
gb.create().fromJson(ResourceUtils.getResourceAsString(inputFile), JsonObject.class);
assertNotNull(jsonObject);
assertTrue(jsonObject.has("name"));
- assertTrue(ret.getName().equals(jsonObject.get("name").getAsString()));
- assertTrue(ret.getAxEvent().getKey().getName().equals(jsonObject.get("name").getAsString()));
+ assertEquals(ret.getName(), jsonObject.get("name").getAsString());
+ assertEquals(ret.getAxEvent().getKey().getName(), jsonObject.get("name").getAsString());
assertTrue(jsonObject.has("nameSpace"));
- assertTrue(ret.getAxEvent().getNameSpace().equals(jsonObject.get("nameSpace").getAsString()));
+ assertEquals(ret.getAxEvent().getNameSpace(), jsonObject.get("nameSpace").getAsString());
assertTrue(jsonObject.has("version"));
- assertTrue(ret.getAxEvent().getKey().getVersion().equals(jsonObject.get("version").getAsString()));
+ assertEquals(ret.getAxEvent().getKey().getVersion(), jsonObject.get("version").getAsString());
final List<String> reserved = Arrays.asList("name", "nameSpace", "version", "source", "target");
for (final Map.Entry<String, ?> e : jsonObject.entrySet()) {
if (reserved.contains(e.getKey())) {
@@ -375,12 +375,12 @@ public class MfpUseCaseTest {
gb.create().fromJson(ResourceUtils.getResourceAsString(inputFile), JsonObject.class);
assertNotNull(jsonObject);
assertTrue(jsonObject.has("name"));
- assertTrue(ret.getName().equals(jsonObject.get("name").getAsString()));
- assertTrue(ret.getAxEvent().getKey().getName().equals(jsonObject.get("name").getAsString()));
+ assertEquals(ret.getName(), jsonObject.get("name").getAsString());
+ assertEquals(ret.getAxEvent().getKey().getName(), jsonObject.get("name").getAsString());
assertTrue(jsonObject.has("nameSpace"));
- assertTrue(ret.getAxEvent().getNameSpace().equals(jsonObject.get("nameSpace").getAsString()));
+ assertEquals(ret.getAxEvent().getNameSpace(), jsonObject.get("nameSpace").getAsString());
assertTrue(jsonObject.has("version"));
- assertTrue(ret.getAxEvent().getKey().getVersion().equals(jsonObject.get("version").getAsString()));
+ assertEquals(ret.getAxEvent().getKey().getVersion(), jsonObject.get("version").getAsString());
final List<String> reserved = Arrays.asList("name", "nameSpace", "version", "source", "target");
for (final Map.Entry<String, ?> e : jsonObject.entrySet()) {
if (reserved.contains(e.getKey())) {