+ /**
+ * Deploy both models and VNF images.
+ *
+ * @throws IOException
+ * @throws BabelArtifactParsingException
+ * @throws InvalidArchiveException
+ */
+ @Test
+ public void testDeploySuccess() throws IOException, BabelArtifactParsingException, InvalidArchiveException {
+ INotificationData data = getNotificationDataWithOneOfEach();
+ byte[] xml = new ArtifactTestUtils().loadResource("convertedYmls/AAI-SCP-Test-VSP-resource-1.0.xml");
+ List<BabelArtifact> toscaArtifacts = setupTest(xml, data);
+ List<Artifact> modelArtifacts = new BabelArtifactConverter().convertToModel(toscaArtifacts);
+
+ List<org.onap.aai.modelloader.entity.Artifact> catalogFiles = new ArrayList<>();
+ catalogFiles.add(new VnfCatalogArtifact("Some catalog content"));
+
+ when(mockVnfCatalogArtifactHandler.pushArtifacts(eq(catalogFiles), eq(data.getDistributionID()), any(), any()))
+ .thenReturn(true);
+ when(mockModelArtifactHandler.pushArtifacts(eq(modelArtifacts), eq(data.getDistributionID()), any(), any()))
+ .thenReturn(true);
+
+ assertThat(manager.deploy(data, modelArtifacts, catalogFiles), is(true));
+
+ Mockito.verify(mockVnfCatalogArtifactHandler).pushArtifacts(eq(catalogFiles), eq(data.getDistributionID()),
+ any(), any());
+ Mockito.verify(mockModelArtifactHandler).pushArtifacts(eq(modelArtifacts), eq(data.getDistributionID()), any(),
+ any());
+ Mockito.verify(mockModelArtifactHandler, Mockito.never()).rollback(any(), any(), any());
+ Mockito.verify(mockVnfCatalogArtifactHandler, Mockito.never()).rollback(any(), any(), any());
+ }