Search in sources :

Example 1 with DistributionStatusMessage

use of org.onap.so.asdc.client.DistributionStatusMessage 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());
}
Also used : IDistributionStatusMessage(org.onap.sdc.api.consumer.IDistributionStatusMessage) DistributionStatusMessage(org.onap.so.asdc.client.DistributionStatusMessage) IDistributionStatusMessage(org.onap.sdc.api.consumer.IDistributionStatusMessage) IDistributionClientResult(org.onap.sdc.api.results.IDistributionClientResult) DistributionClientResultImpl(org.onap.sdc.impl.DistributionClientResultImpl) Test(org.junit.Test)

Example 2 with DistributionStatusMessage

use of org.onap.so.asdc.client.DistributionStatusMessage 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());
}
Also used : IDistributionStatusMessage(org.onap.sdc.api.consumer.IDistributionStatusMessage) DistributionStatusMessage(org.onap.so.asdc.client.DistributionStatusMessage) IDistributionStatusMessage(org.onap.sdc.api.consumer.IDistributionStatusMessage) IDistributionClientResult(org.onap.sdc.api.results.IDistributionClientResult) DistributionClientResultImpl(org.onap.sdc.impl.DistributionClientResultImpl) Test(org.junit.Test)

Example 3 with DistributionStatusMessage

use of org.onap.so.asdc.client.DistributionStatusMessage 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());
}
Also used : IDistributionStatusMessage(org.onap.sdc.api.consumer.IDistributionStatusMessage) DistributionStatusMessage(org.onap.so.asdc.client.DistributionStatusMessage) IDistributionStatusMessage(org.onap.sdc.api.consumer.IDistributionStatusMessage) IDistributionClientResult(org.onap.sdc.api.results.IDistributionClientResult) DistributionClientResultImpl(org.onap.sdc.impl.DistributionClientResultImpl) Test(org.junit.Test)

Example 4 with DistributionStatusMessage

use of org.onap.so.asdc.client.DistributionStatusMessage 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());
}
Also used : IDistributionStatusMessage(org.onap.sdc.api.consumer.IDistributionStatusMessage) DistributionStatusMessage(org.onap.so.asdc.client.DistributionStatusMessage) IDistributionStatusMessage(org.onap.sdc.api.consumer.IDistributionStatusMessage) IDistributionClientResult(org.onap.sdc.api.results.IDistributionClientResult) DistributionClientResultImpl(org.onap.sdc.impl.DistributionClientResultImpl) Test(org.junit.Test)

Example 5 with DistributionStatusMessage

use of org.onap.so.asdc.client.DistributionStatusMessage in project so by onap.

the class DistributionClientEmulatorTest method getDistributionMessageReceived.

@Test
public void getDistributionMessageReceived() {
    List<IDistributionStatusMessage> receivedMessages = distClientEmulator.getDistributionMessageReceived();
    assertEquals(new LinkedList<>(), receivedMessages);
    IDistributionStatusMessage message = new DistributionStatusMessage("testArtifactUrl", "testConsumerId", "testDistributionId", DistributionStatusEnum.DOWNLOAD_OK, 123456);
    distClientEmulator.sendDeploymentStatus(message);
    assertEquals(message, receivedMessages.get(0));
    IDistributionStatusMessage message2 = new DistributionStatusMessage("testArtifactUrl2", "testConsumerId2", "testDistributionId2", DistributionStatusEnum.DOWNLOAD_OK, 1234567);
    distClientEmulator.sendDeploymentStatus(message2);
    assertEquals(message2, receivedMessages.get(1));
}
Also used : IDistributionStatusMessage(org.onap.sdc.api.consumer.IDistributionStatusMessage) DistributionStatusMessage(org.onap.so.asdc.client.DistributionStatusMessage) IDistributionStatusMessage(org.onap.sdc.api.consumer.IDistributionStatusMessage) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)5 IDistributionStatusMessage (org.onap.sdc.api.consumer.IDistributionStatusMessage)5 DistributionStatusMessage (org.onap.so.asdc.client.DistributionStatusMessage)5 IDistributionClientResult (org.onap.sdc.api.results.IDistributionClientResult)4 DistributionClientResultImpl (org.onap.sdc.impl.DistributionClientResultImpl)4