summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/test/java
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-be/src/test/java')
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ArtifactBusinessLogicTest.java5
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogicTest.java16
2 files changed, 5 insertions, 16 deletions
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ArtifactBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ArtifactBusinessLogicTest.java
index 616d9e42f9..fdc762ed44 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ArtifactBusinessLogicTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ArtifactBusinessLogicTest.java
@@ -466,10 +466,7 @@ public class ArtifactBusinessLogicTest extends BaseBusinessLogicMock{
DAOArtifactData.setDataAsArray(payload);
Either<DAOArtifactData, CassandraOperationStatus> artifactfromESres = Either.left(DAOArtifactData);
when(artifactCassandraDao.getArtifact(esArtifactId)).thenReturn(artifactfromESres);
- List<org.openecomp.sdc.be.model.Component> serviceList = new ArrayList<>();
- serviceList.add(service);
- Either<List<org.openecomp.sdc.be.model.Component>, StorageOperationStatus> getServiceRes = Either.left(serviceList);
- when(toscaOperationFacade.getBySystemName(ComponentTypeEnum.SERVICE, serviceName)).thenReturn(getServiceRes);
+ when(toscaOperationFacade.getBySystemNameAndVersion(ComponentTypeEnum.SERVICE, serviceName,serviceVersion)).thenReturn(Either.left(service));
byte[] downloadServiceArtifactByNamesRes =
artifactBL.downloadServiceArtifactByNames(serviceName, serviceVersion, artifactName);
assertThat(downloadServiceArtifactByNamesRes !=null &&
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogicTest.java
index c13a46500f..54ccf2bee9 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogicTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogicTest.java
@@ -728,11 +728,7 @@ public class ArtifactsBusinessLogicTest extends BaseBusinessLogicMock {
DAOArtifactData.setDataAsArray(payload);
Either<DAOArtifactData, CassandraOperationStatus> artifactfromESres = Either.left(DAOArtifactData);
when(artifactCassandraDao.getArtifact(esArtifactId)).thenReturn(artifactfromESres);
- List<org.openecomp.sdc.be.model.Component> serviceList = new ArrayList<>();
- serviceList.add(service);
- Either<List<org.openecomp.sdc.be.model.Component>, StorageOperationStatus> getServiceRes = Either
- .left(serviceList);
- when(toscaOperationFacade.getBySystemName(ComponentTypeEnum.SERVICE, serviceName)).thenReturn(getServiceRes);
+ when(toscaOperationFacade.getBySystemNameAndVersion(ComponentTypeEnum.SERVICE, serviceName, serviceVersion)).thenReturn(Either.left(service));
byte[] downloadServiceArtifactByNamesRes = artifactBL
.downloadServiceArtifactByNames(serviceName, serviceVersion, artifactName);
assertThat(downloadServiceArtifactByNamesRes != null
@@ -2428,19 +2424,15 @@ public class ArtifactsBusinessLogicTest extends BaseBusinessLogicMock {
esArtifactData.setDataAsArray("test".getBytes());
artifactDefinition.setArtifactName(artifactName);
- List<Service> serviceList = new ArrayList<>();
Map<String, ArtifactDefinition> artifacts = new HashMap<>();
artifacts.put(artifactName, artifactDefinition);
-
- serviceList.add(service);
resource.setDeploymentArtifacts(artifacts);
when(toscaOperationFacade.getComponentByNameAndVersion(eq(ComponentTypeEnum.RESOURCE), eq(resourceName), eq(version),
eq(JsonParseFlagEnum.ParseMetadata)))
.thenReturn(Either.left(resource));
- doReturn(Either.left(serviceList)).when(toscaOperationFacade).getBySystemName(eq(ComponentTypeEnum.SERVICE), eq(serviceName));
- when(artifactCassandraDao.getArtifact(any()))
- .thenReturn(Either.left(esArtifactData));
+ doReturn(Either.left(service)).when(toscaOperationFacade).getBySystemNameAndVersion(ComponentTypeEnum.SERVICE, serviceName, version);
+ when(artifactCassandraDao.getArtifact(any())).thenReturn(Either.left(esArtifactData));
byte[] result = artifactBL.downloadRsrcArtifactByNames(serviceName, version, resourceName, version, artifactName);
Assert.assertEquals(esArtifactData.getDataAsArray(), result);
@@ -2455,4 +2447,4 @@ public class ArtifactsBusinessLogicTest extends BaseBusinessLogicMock {
artifactsBusinessLogic.setComponentsUtils(componentsUtils);
return artifactsBusinessLogic;
}
-} \ No newline at end of file
+}