aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Brady <pb071s@att.com>2017-09-27 13:52:25 -0700
committerPatrick Brady <pb071s@att.com>2017-09-27 13:53:31 -0700
commita51683d2c64b86086a49ec0623c41823502f6503 (patch)
treeab49ff6bcf24b119692d0b6d3ecf247ad1365a1a
parent61d4327f8cfc7ad42f548766a67af2b73eb0fa11 (diff)
Revert Increase coverage of SDC Event Listener
This reverts commit 8b88bb6f258cf8af9d1658a0514eba6daa31f93c. The commit is causing test failures and blocks all jobs. Change-Id: I1e82f74d34bc4201690beea89bebe61c9d3845e2 Signed-off-by: Patrick Brady <pb071s@att.com> Issue-id: APPC-228
-rw-r--r--appc-sdc-listener/appc-sdc-listener-bundle/src/test/java/org/openecomp/appc/sdc/listener/SdcCallbackTest.java34
1 files changed, 15 insertions, 19 deletions
diff --git a/appc-sdc-listener/appc-sdc-listener-bundle/src/test/java/org/openecomp/appc/sdc/listener/SdcCallbackTest.java b/appc-sdc-listener/appc-sdc-listener-bundle/src/test/java/org/openecomp/appc/sdc/listener/SdcCallbackTest.java
index 66550acea..9e2a86051 100644
--- a/appc-sdc-listener/appc-sdc-listener-bundle/src/test/java/org/openecomp/appc/sdc/listener/SdcCallbackTest.java
+++ b/appc-sdc-listener/appc-sdc-listener-bundle/src/test/java/org/openecomp/appc/sdc/listener/SdcCallbackTest.java
@@ -25,7 +25,6 @@
package org.openecomp.appc.sdc.listener;
import org.junit.Before;
-import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Matchers;
import org.mockito.Mockito;
@@ -33,7 +32,6 @@ import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.openecomp.appc.adapter.message.EventSender;
import org.openecomp.appc.sdc.artifacts.helper.ArtifactStorageService;
-import org.openecomp.appc.sdc.artifacts.helper.DependencyModelGenerator;
import org.openecomp.appc.sdc.artifacts.impl.ArtifactProcessorFactory;
import org.openecomp.appc.sdc.artifacts.impl.ToscaCsarArtifactProcessor;
import org.openecomp.appc.sdc.artifacts.object.SDCArtifact;
@@ -64,11 +62,10 @@ import java.util.List;
@RunWith(PowerMockRunner.class)
@PrepareForTest({IDistributionClient.class,
- EventSender.class,
- ArtifactStorageService.class,
- ToscaCsarArtifactProcessor.class,
- ArtifactProcessorFactory.class,
- DependencyModelGenerator.class})
+ EventSender.class,
+ ArtifactStorageService.class,
+ ToscaCsarArtifactProcessor.class,
+ ArtifactProcessorFactory.class})
public class SdcCallbackTest {
IDistributionClient client;
@@ -88,12 +85,11 @@ public class SdcCallbackTest {
,getServiceArtifacts().get(0),null));
storageService = PowerMockito.mock(ArtifactStorageService.class);
Whitebox.setInternalState(artifactProcessor,"artifactStorageService", storageService);
- DependencyModelGenerator dependencyModelGeneratorMock=PowerMockito.mock(DependencyModelGenerator.class);
- Whitebox.setInternalState(artifactProcessor,"dependencyModelGenerator",dependencyModelGeneratorMock);
- PowerMockito.when(dependencyModelGeneratorMock.getDependencyModel(Matchers.anyString(),Matchers.anyString())).thenReturn("Dependency_Model");
+
PowerMockito.doCallRealMethod().when(artifactProcessor).processArtifact((IDistributionClientDownloadResult) Matchers.anyObject());
PowerMockito.doCallRealMethod().when(artifactProcessor).run();
+
PowerMockito.mockStatic(ArtifactProcessorFactory.class);
PowerMockito.when(ArtifactProcessorFactory.getArtifactProcessor((IDistributionClient)Matchers.anyObject(), (EventSender)Matchers.anyObject(),
(INotificationData)Matchers.anyObject(), (IResourceInstance)Matchers.anyObject(),
@@ -128,23 +124,23 @@ public class SdcCallbackTest {
}
- @Test
+// @Test
public void testSDCListener() throws ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException {
INotificationData notificationData = getNotificationData();
sdcCallback.activateCallback(notificationData);
- pause();
+// pause();
}
- private void pause() {
- try {
- Thread.sleep(5000);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
+// private void pause(){
+// try {
+// Thread.sleep(50000000);
+// } catch (InterruptedException e) {
+// e.printStackTrace();
+// }
+// }
private INotificationData getNotificationData() throws ClassNotFoundException, IllegalAccessException, InstantiationException, InvocationTargetException {