use of org.onap.sdc.api.consumer.IDistributionStatusMessage in project so by onap.
the class DistributionClientEmulatorTest method sendDeploymentStatusPrimary.
@Test
public void sendDeploymentStatusPrimary() {
IDistributionStatusMessage message = new DistributionStatusMessage("testArtifactUrl", "testConsumerId", "testDistributionId", DistributionStatusEnum.DOWNLOAD_OK, 123456);
IDistributionClientResult result = distClientEmulator.sendDeploymentStatus(message);
IDistributionClientResult expectedResult = new DistributionClientResultImpl(DistributionActionResultEnum.SUCCESS, DistributionActionResultEnum.SUCCESS.name());
assertEquals(message, distClientEmulator.getDistributionMessageReceived().get(0));
assertEquals(expectedResult.getDistributionActionResult(), result.getDistributionActionResult());
assertEquals(expectedResult.getDistributionMessageResult(), result.getDistributionMessageResult());
}
use of org.onap.sdc.api.consumer.IDistributionStatusMessage in project so by onap.
the class DistributionClientEmulatorTest method sendDeploymentStatusSecondary.
@Test
public void sendDeploymentStatusSecondary() {
IDistributionStatusMessage message = new DistributionStatusMessage("testArtifactUrl", "testConsumerId", "testDistributionId", DistributionStatusEnum.DOWNLOAD_OK, 123456);
IDistributionClientResult result = distClientEmulator.sendDeploymentStatus(message, "test");
IDistributionClientResult expectedResult = new DistributionClientResultImpl(DistributionActionResultEnum.SUCCESS, DistributionActionResultEnum.SUCCESS.name());
assertEquals(message, distClientEmulator.getDistributionMessageReceived().get(0));
assertEquals(expectedResult.getDistributionActionResult(), result.getDistributionActionResult());
assertEquals(expectedResult.getDistributionMessageResult(), result.getDistributionMessageResult());
}
use of org.onap.sdc.api.consumer.IDistributionStatusMessage in project so by onap.
the class DistributionClientEmulatorTest method sendDownloadStatusPrimary.
@Test
public void sendDownloadStatusPrimary() {
IDistributionStatusMessage message = new DistributionStatusMessage("testArtifactUrl", "testConsumerId", "testDistributionId", DistributionStatusEnum.DOWNLOAD_OK, 123456);
IDistributionClientResult result = distClientEmulator.sendDownloadStatus(message);
IDistributionClientResult expectedResult = new DistributionClientResultImpl(DistributionActionResultEnum.SUCCESS, DistributionActionResultEnum.SUCCESS.name());
assertEquals(message, distClientEmulator.getDistributionMessageReceived().get(0));
assertEquals(expectedResult.getDistributionActionResult(), result.getDistributionActionResult());
assertEquals(expectedResult.getDistributionMessageResult(), result.getDistributionMessageResult());
}
use of org.onap.sdc.api.consumer.IDistributionStatusMessage in project so by onap.
the class ASDCController method sendASDCNotification.
protected void sendASDCNotification(NotificationType notificationType, String artifactURL, String consumerID, String distributionID, DistributionStatusEnum status, String errorReason, long timestamp) {
String event = "Sending " + notificationType.name() + "(" + status.name() + ")" + " notification to ASDC for artifact:" + artifactURL;
if (errorReason != null) {
event = event + "(" + errorReason + ")";
}
logger.info(LoggingAnchor.SIX, MessageEnum.ASDC_SEND_NOTIF_ASDC.toString(), notificationType.name(), status.name(), artifactURL, "ASDC", "sendASDCNotification");
logger.debug(event);
try {
IDistributionStatusMessage message = new DistributionStatusMessage(artifactURL, consumerID, distributionID, status, timestamp);
if (errorReason != null) {
sendNotificationWithMessageAndErrorReason(notificationType, errorReason, message);
} else {
sendNotificationWithMessage(notificationType, message);
}
} catch (RuntimeException e) {
logger.warn(LoggingAnchor.FIVE, MessageEnum.ASDC_SEND_NOTIF_ASDC_EXEC.toString(), "ASDC", "sendASDCNotification", ErrorCode.SchemaError.getValue(), "RuntimeException - sendASDCNotification", e);
}
}
use of org.onap.sdc.api.consumer.IDistributionStatusMessage in project so by onap.
the class DistributionClientEmulatorTest method sendDownloadStatusSecondary.
@Test
public void sendDownloadStatusSecondary() {
IDistributionStatusMessage message = new DistributionStatusMessage("testArtifactUrl", "testConsumerId", "testDistributionId", DistributionStatusEnum.DOWNLOAD_OK, 123456);
IDistributionClientResult result = distClientEmulator.sendDownloadStatus(message, "test");
IDistributionClientResult expectedResult = new DistributionClientResultImpl(DistributionActionResultEnum.SUCCESS, DistributionActionResultEnum.SUCCESS.name());
assertEquals(message, distClientEmulator.getDistributionMessageReceived().get(0));
assertEquals(expectedResult.getDistributionActionResult(), result.getDistributionActionResult());
assertEquals(expectedResult.getDistributionMessageResult(), result.getDistributionMessageResult());
}
Aggregations