Search in sources :

Example 1 with IDistributionClientResult

use of org.onap.sdc.api.results.IDistributionClientResult 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 IDistributionClientResult

use of org.onap.sdc.api.results.IDistributionClientResult in project so by onap.

the class DistributionClientEmulatorTest method start.

@Test
public void start() {
    IDistributionClientResult result = distClientEmulator.start();
    IDistributionClientResult expectedResult = new DistributionClientResultImpl(DistributionActionResultEnum.SUCCESS, DistributionActionResultEnum.SUCCESS.name());
    assertEquals(expectedResult.getDistributionActionResult(), result.getDistributionActionResult());
    assertEquals(expectedResult.getDistributionMessageResult(), result.getDistributionMessageResult());
}
Also used : IDistributionClientResult(org.onap.sdc.api.results.IDistributionClientResult) DistributionClientResultImpl(org.onap.sdc.impl.DistributionClientResultImpl) Test(org.junit.Test)

Example 3 with IDistributionClientResult

use of org.onap.sdc.api.results.IDistributionClientResult in project so by onap.

the class DistributionClientEmulatorTest method initPrimary.

@Test
public void initPrimary() {
    IDistributionClientResult result = distClientEmulator.init(new ASDCConfiguration(), new ASDCNotificationCallBack());
    IDistributionClientResult expectedResult = new DistributionClientResultImpl(DistributionActionResultEnum.SUCCESS, DistributionActionResultEnum.SUCCESS.name());
    assertEquals(expectedResult.getDistributionActionResult(), result.getDistributionActionResult());
    assertEquals(expectedResult.getDistributionMessageResult(), result.getDistributionMessageResult());
}
Also used : IDistributionClientResult(org.onap.sdc.api.results.IDistributionClientResult) ASDCConfiguration(org.onap.so.asdc.client.ASDCConfiguration) ASDCNotificationCallBack(org.onap.so.asdc.client.ASDCNotificationCallBack) DistributionClientResultImpl(org.onap.sdc.impl.DistributionClientResultImpl) Test(org.junit.Test)

Example 4 with IDistributionClientResult

use of org.onap.sdc.api.results.IDistributionClientResult 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 5 with IDistributionClientResult

use of org.onap.sdc.api.results.IDistributionClientResult 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)

Aggregations

IDistributionClientResult (org.onap.sdc.api.results.IDistributionClientResult)10 Test (org.junit.Test)9 DistributionClientResultImpl (org.onap.sdc.impl.DistributionClientResultImpl)9 IDistributionStatusMessage (org.onap.sdc.api.consumer.IDistributionStatusMessage)4 DistributionStatusMessage (org.onap.so.asdc.client.DistributionStatusMessage)4 ASDCConfiguration (org.onap.so.asdc.client.ASDCConfiguration)3 ASDCNotificationCallBack (org.onap.so.asdc.client.ASDCNotificationCallBack)2 ASDCStatusCallBack (org.onap.so.asdc.client.ASDCStatusCallBack)1 ASDCControllerException (org.onap.so.asdc.client.exceptions.ASDCControllerException)1