summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorGabriel <adam.krysiak@nokia.com>2018-07-03 10:30:01 +0200
committerGabriel <adam.krysiak@nokia.com>2018-07-03 10:51:53 +0200
commit0cfec3c5d53ed995e66f135ccd584d7ab0950258 (patch)
treea34114ae5e43a4c520e775c68851d241974bec64 /src/test
parent628985aac4fbe481e20acb1a5578fe41749ea5ae (diff)
Fix weakness causing NPE
Change-Id: I1f6bfa75990082dc411d813528702cc3cc140f5c Issue-ID: CLAMP-193 Signed-off-by: Gabriel <adam.krysiak@nokia.com>
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/onap/clamp/clds/it/SdcCatalogServicesItCase.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/java/org/onap/clamp/clds/it/SdcCatalogServicesItCase.java b/src/test/java/org/onap/clamp/clds/it/SdcCatalogServicesItCase.java
index 4a13c62aa..330ee6056 100644
--- a/src/test/java/org/onap/clamp/clds/it/SdcCatalogServicesItCase.java
+++ b/src/test/java/org/onap/clamp/clds/it/SdcCatalogServicesItCase.java
@@ -17,14 +17,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
* ============LICENSE_END============================================
+ * Modifications copyright (c) 2018 Nokia
* ===================================================================
*
*/
package org.onap.clamp.clds.it;
+import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertTrue;
+import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
@@ -170,6 +173,23 @@ public class SdcCatalogServicesItCase {
assertTrue("1.0".equals(res2.getVersion()));
}
+
+ @Test
+ public void removeDuplicateSdcFunctionShouldNotReturnNull(){
+ // given
+ SdcCatalogServices catalogServices = new SdcCatalogServices();
+
+ // when
+ List<SdcResourceBasicInfo> firstResult = catalogServices
+ .removeDuplicateSdcResourceBasicInfo(null);
+ List<SdcResourceBasicInfo> secondResult = catalogServices
+ .removeDuplicateSdcResourceBasicInfo(new ArrayList<>());
+
+ // then
+ assertThat(firstResult).isEmpty();
+ assertThat(secondResult).isEmpty();
+ }
+
@Test
public void getServiceUuidFromServiceInvariantIdTest() throws Exception {
SdcCatalogServices spy = Mockito.spy(sdcCatalogWired);