diff options
author | Lukasz Muszkieta <lukasz.muszkieta@nokia.com> | 2020-06-02 15:12:11 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-06-02 15:12:11 +0000 |
commit | 48aad3a3181c6990abb84206027555d473cf71b3 (patch) | |
tree | a4eed3ce76dfb30d3913b31e45738907d854b7fd /adapters/mso-openstack-adapters/src/test | |
parent | ebff4ef04bbd786ced77b121420ce23b8a6f0a7c (diff) | |
parent | abe242987a35b162e2386b910c3f0cef6e3fef33 (diff) |
Merge "Sonar fixes"
Diffstat (limited to 'adapters/mso-openstack-adapters/src/test')
2 files changed, 8 insertions, 9 deletions
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/audit/AbstractAuditServiceTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/audit/AbstractAuditServiceTest.java index a93897f83e..c70e60e9d3 100644 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/audit/AbstractAuditServiceTest.java +++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/audit/AbstractAuditServiceTest.java @@ -3,35 +3,34 @@ package org.onap.so.adapters.tasks.audit; import org.junit.Test; import org.onap.so.objects.audit.AAIObjectAudit; import org.onap.so.objects.audit.AAIObjectAuditList; -import java.util.Optional; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; public class AbstractAuditServiceTest extends AbstractAuditService { - private AAIObjectAuditList getAuditListWithObjectWithExistenceStateOf(boolean existState) { + private AAIObjectAuditList getAuditListWithObjectWithExistenceStateOf(boolean existenceState) { AAIObjectAudit auditObject = new AAIObjectAudit(); AAIObjectAuditList auditList = new AAIObjectAuditList(); - auditObject.setDoesObjectExist(existState); + auditObject.setDoesObjectExist(existenceState); auditList.getAuditList().add(auditObject); return auditList; } @Test - public void didCreateAuditFail_shouldReturnFalse_whenGivenEmptyAudit() { - assertFalse(didCreateAuditFail(Optional.empty())); + public void didCreateAuditFail_shouldReturnFalse_whenGivenNull() { + assertFalse(didCreateAuditFail(null)); } @Test public void didCreateAuditFail_shouldReturnTrue_whenGivenNotExistingObject() { - assertTrue(didCreateAuditFail(Optional.of(getAuditListWithObjectWithExistenceStateOf(false)))); + assertTrue(didCreateAuditFail(getAuditListWithObjectWithExistenceStateOf(false))); } @Test public void didCreateAuditFail_shouldReturnFalse_whenGivenExistingObject() { - assertFalse(didCreateAuditFail(Optional.of(getAuditListWithObjectWithExistenceStateOf(true)))); + assertFalse(didCreateAuditFail(getAuditListWithObjectWithExistenceStateOf(true))); } @Test diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/audit/AuditStackServiceDataTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/audit/AuditStackServiceDataTest.java index a10ab4b7df..78dbcd94c2 100644 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/audit/AuditStackServiceDataTest.java +++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/audit/AuditStackServiceDataTest.java @@ -179,13 +179,13 @@ public class AuditStackServiceDataTest extends AuditCreateStackService { @Test public void determineAuditResult_Test() throws Exception { - boolean actual = auditStackService.didCreateAuditFail(auditListOptSuccess); + boolean actual = auditStackService.didCreateAuditFail(auditListOptSuccess.get()); assertEquals(false, actual); } @Test public void determineAuditResult_Failure_Test() throws Exception { - boolean actual = auditStackService.didCreateAuditFail(auditListOptFailure); + boolean actual = auditStackService.didCreateAuditFail(auditListOptFailure.get()); assertEquals(true, actual); } } |