diff options
author | Abhai Singh <Abhai.Singh@amdocs.com> | 2017-09-28 19:37:54 +0530 |
---|---|---|
committer | Abhai Singh <Abhai.Singh@amdocs.com> | 2017-09-29 12:18:52 +0530 |
commit | 8789ac428adbb5d5782bfa93a0baebc9070f3ac7 (patch) | |
tree | 4886d82633d974c46f96071ba8cf28be9d28fac4 /appc-sdc-listener/appc-sdc-listener-bundle/src/main | |
parent | e4894932713469508bbb68fdb4b8d8cfcb0a4076 (diff) |
[APPC-246] Updating SDC Listener with unit test
Created new test classes for SDC-Listener.
Contains changes reverted by Patrick.
Issue-Id :APPC-246
Change-Id: I593b23bae44db0046f513f4b6a159a86bf8cc885
Signed-off-by: Abhai Singh <Abhai.Singh@amdocs.com>
Diffstat (limited to 'appc-sdc-listener/appc-sdc-listener-bundle/src/main')
2 files changed, 5 insertions, 4 deletions
diff --git a/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/ArtifactProcessorFactory.java b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/ArtifactProcessorFactory.java index 7dbd191ca..ba01cbc24 100644 --- a/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/ArtifactProcessorFactory.java +++ b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/ArtifactProcessorFactory.java @@ -43,7 +43,7 @@ public class ArtifactProcessorFactory { private static final EELFLogger logger = EELFManager.getInstance().getLogger(ArtifactProcessorFactory.class); - private ArtifactProcessorFactory (){ + public ArtifactProcessorFactory (){ } @@ -57,7 +57,7 @@ public class ArtifactProcessorFactory { * @param storeUri * @return */ - public static ArtifactProcessor getArtifactProcessor(IDistributionClient client, EventSender eventSender, + public ArtifactProcessor getArtifactProcessor(IDistributionClient client, EventSender eventSender, INotificationData notification, IResourceInstance resource, IArtifactInfo artifact, URI storeUri) { diff --git a/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/SdcCallback.java b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/SdcCallback.java index 3d4e3d4c1..d9fd2a4a1 100644 --- a/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/SdcCallback.java +++ b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/SdcCallback.java @@ -49,6 +49,7 @@ import java.util.concurrent.atomic.AtomicBoolean; public class SdcCallback implements INotificationCallback { private final EELFLogger logger = EELFManager.getInstance().getLogger(SdcCallback.class); + private ArtifactProcessorFactory artifactProcessorFactory=new ArtifactProcessorFactory(); private URI storeUri; private IDistributionClient client; @@ -91,7 +92,7 @@ public class SdcCallback implements INotificationCallback { if (isRunning.get()) { for(IArtifactInfo artifact:data.getServiceArtifacts()){ - ArtifactProcessor artifactProcessor = ArtifactProcessorFactory.getArtifactProcessor(client, eventSender, data, null, artifact, storeUri); + ArtifactProcessor artifactProcessor = artifactProcessorFactory.getArtifactProcessor(client, eventSender, data, null, artifact, storeUri); if(artifactProcessor!=null){ executor.submit(artifactProcessor); } @@ -103,7 +104,7 @@ public class SdcCallback implements INotificationCallback { if (executor.getQueue().size() >= threadCount) { // log warning about job backlog } - ArtifactProcessor artifactProcessor = ArtifactProcessorFactory.getArtifactProcessor(client, eventSender, data, resource, artifact, storeUri); + ArtifactProcessor artifactProcessor = artifactProcessorFactory.getArtifactProcessor(client, eventSender, data, resource, artifact, storeUri); if(artifactProcessor != null){ executor.submit(artifactProcessor); } |