Query CatalogDB for WorkflowSpecifications
[so.git] / mso-catalog-db / src / test / java / org / onap / so / db / catalog / data / repository / WorkflowRepositoryTest.java
index d541627..4f31e4b 100644 (file)
@@ -18,12 +18,10 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import java.util.List;
+import org.junit.Assert;
 import org.junit.Test;
 import org.onap.so.db.catalog.BaseTest;
-import org.onap.so.db.catalog.beans.PnfResource;
-import org.onap.so.db.catalog.beans.PnfResourceCustomization;
 import org.onap.so.db.catalog.beans.Workflow;
-import org.onap.so.db.catalog.exceptions.NoEntityFoundException;
 import org.springframework.beans.factory.annotation.Autowired;
 
 public class WorkflowRepositoryTest extends BaseTest {
@@ -38,4 +36,14 @@ public class WorkflowRepositoryTest extends BaseTest {
         assertEquals("artifactName", "testingWorkflow", workflow.getArtifactName());
     }
 
+    @Test
+    public void findByVnfResourceModelUUIDTest() throws Exception {
+        List<Workflow> workflows = workflowRepository.findWorkflowByModelUUID("ff2ae348-214a-11e7-93ae-92361f002671");
+
+        Assert.assertTrue(workflows != null);
+        Assert.assertTrue(workflows.size() != 0);
+
+        Assert.assertTrue("testingWorkflow".equals(workflows.get(0).getArtifactName()));
+    }
+
 }