X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ecomp-portal-BE-common%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fportalapp%2Fportal%2Fdomain%2FExternalSystemAccessTest.java;h=f99149dad3e0c4e976a96996c72af59af5f8819d;hb=aa9b320ff93511280cf51b03d38fb9254af6b530;hp=d51d5e5c102feef479987fe903eee5dc5a944572;hpb=fe3a67c11b65d7989a6ef648c3f34eee8abe7394;p=portal.git diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/ExternalSystemAccessTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/ExternalSystemAccessTest.java index d51d5e5c..f99149da 100644 --- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/ExternalSystemAccessTest.java +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/ExternalSystemAccessTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed @@ -38,9 +38,10 @@ package org.onap.portalapp.portal.domain; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import org.junit.Test; -import org.onap.portalapp.portal.domain.ExternalSystemAccess; public class ExternalSystemAccessTest { @@ -52,13 +53,23 @@ public class ExternalSystemAccessTest { return externalSystemAccess; } + + @Test public void externalSystemAccessTest(){ - ExternalSystemAccess externalSystemAccess = mockExternalSystemAccess(); + ExternalSystemAccess externalSystem=mockExternalSystemAccess(); + ExternalSystemAccess externalSystemAccess = new ExternalSystemAccess("test", false); + externalSystemAccess.setKey(externalSystem.getKey()); + externalSystemAccess.setAccessValue(externalSystem.getAccessValue()); + assertEquals(externalSystemAccess.hashCode(), externalSystem.hashCode()); + assertTrue(externalSystemAccess.equals(externalSystem)); + assertFalse(externalSystemAccess.equals(null)); - assertEquals(externalSystemAccess.getKey(), "test"); - assertEquals(externalSystemAccess.getAccessValue(), false); + externalSystemAccess.setKey(null); + assertFalse(externalSystemAccess.equals(externalSystem)); + externalSystemAccess.setAccessValue(null); + assertFalse(externalSystemAccess.equals(externalSystem)); } }