Add unit test for CompositionEntityDataManagerImpl 32/90432/2
authorm.kowalski3 <m.kowalski3@partner.samsung.com>
Tue, 25 Jun 2019 10:07:36 +0000 (12:07 +0200)
committerOren Kleks <orenkle@amdocs.com>
Tue, 25 Jun 2019 12:14:00 +0000 (12:14 +0000)
Issue-ID: SDC-2327
Signed-off-by: Marcin Kowalski <m.kowalski3@partner.samsung.com>
Change-Id: I77efe6d3da88de11ea41484d5ce17d736d6d142b

openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/CompositionEntityDataManagerImplTest.java

index 836767d..a7da29d 100644 (file)
@@ -4,6 +4,8 @@
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -33,7 +35,6 @@ import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspQuestionnaireEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.impl.CompositionEntityDataManagerImpl;
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId;
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType;
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityValidationData;
@@ -281,4 +282,14 @@ public class CompositionEntityDataManagerImplTest {
   private static String loadFileToString(String path) {
     return new String(FileUtils.toByteArray(FileUtils.loadFileToInputStream(path)));
   }
-}
\ No newline at end of file
+
+  @Test(expected = CoreException.class)
+  public void shouldReturnCoreException() {
+    //given
+    NetworkCompositionSchemaInput schemaTemplateInput = new NetworkCompositionSchemaInput();
+
+    //then
+    compositionEntityDataManager.validateEntity(null, SchemaTemplateContext.composition, schemaTemplateInput);
+  }
+
+}