From b3d4898d9e8452ea0b8d848c048e712d43b8d9a3 Mon Sep 17 00:00:00 2001 From: Michael Lando Date: Sun, 11 Jun 2017 14:22:02 +0300 Subject: [SDC-29] rebase continue work to align source Change-Id: I218f1c5ee23fb2c8314f1c70921d3ad8682c10f4 Signed-off-by: Michael Lando --- .../artifact/ProcessArtifactEnricherTest.java | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java') diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/external/artifact/ProcessArtifactEnricherTest.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/external/artifact/ProcessArtifactEnricherTest.java index cfb241483a..aeefc91aa3 100644 --- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/external/artifact/ProcessArtifactEnricherTest.java +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/external/artifact/ProcessArtifactEnricherTest.java @@ -28,6 +28,7 @@ import java.util.Collection; import static org.mockito.Matchers.anyObject; import static org.mockito.Mockito.atLeastOnce; +import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.when; public class ProcessArtifactEnricherTest { @@ -56,7 +57,6 @@ public class ProcessArtifactEnricherTest { version.setMinor(0); ComponentEntity componentEntity = getComponentEntity(vspId, version, componentId); - setMockToEnrichComponent(vspId, componentId, version); ProcessEntity entity = new ProcessEntity(vspId, version, componentId, null); ProcessEntity processEntity = new ProcessEntity(); @@ -64,6 +64,8 @@ public class ProcessArtifactEnricherTest { processEntity.setVspId(vspId); processEntity.setVersion(version); processEntity.setComponentId(componentId); + processEntity.setArtifactName("artifact_1kb.txt"); + processEntity.setArtifact(getMibByteBuffer("/mock/enrichProcess/artifact_1kb.txt")); Collection componentList = new ArrayList(); componentList.add(componentEntity); @@ -73,6 +75,8 @@ public class ProcessArtifactEnricherTest { list.add(processEntity); when(processDaoMock.list(entity)).thenReturn(list); + when(processDaoMock.get(anyObject())).thenReturn(processEntity); + EnrichmentInfo info = new EnrichmentInfo(); info.setVersion(version); info.setKey(vspId); @@ -92,19 +96,6 @@ public class ProcessArtifactEnricherTest { } - private void setMockToEnrichComponent(String vspId, String componentId, Version version) { - ProcessEntity returnedArtifact = new ProcessEntity(); - returnedArtifact.setVspId(vspId); - returnedArtifact.setVersion(version); - returnedArtifact.setComponentId(componentId); - returnedArtifact.setArtifactName("artifact_1kb.txt"); - returnedArtifact.setArtifact(getMibByteBuffer("/mock/enrichProcess/artifact_1kb.txt")); - - Mockito.when(processDaoMock.get(anyObject())) - .thenReturn(returnedArtifact); - Mockito.doNothing().when(enrichedServiceModelDaoMock).storeExternalArtifact(anyObject()); - } - private ComponentEntity getComponentEntity(String vspId, Version version, String componentId) { ComponentEntity componentEntity = new ComponentEntity(); componentEntity.setId(componentId); -- cgit 1.2.3-korg