Search in sources :

Example 1 with IStatusData

use of org.onap.sdc.api.notification.IStatusData in project so by onap.

the class ASDCStatusCallBackTest method activateCallbackExceptionTest.

@Test
public void activateCallbackExceptionTest() throws Exception {
    IStatusData statusData = mock(IStatusData.class);
    doReturn("distributionId").when(statusData).getDistributionID();
    doReturn("componentName").when(statusData).getComponentName();
    doReturn(DistributionStatusEnum.COMPONENT_DONE_OK).when(statusData).getStatus();
    doThrow(ArtifactInstallerException.class).when(toscaInstaller).installTheComponentStatus(isA(IStatusData.class));
    statusCallback.activateCallback(statusData);
}
Also used : IStatusData(org.onap.sdc.api.notification.IStatusData) BaseTest(org.onap.so.asdc.BaseTest) Test(org.junit.Test)

Example 2 with IStatusData

use of org.onap.sdc.api.notification.IStatusData in project so by onap.

the class ASDCStatusCallBackTest method activateCallbackDoneErrorStatusTest.

@Test
public void activateCallbackDoneErrorStatusTest() throws Exception {
    IStatusData statusData = mock(IStatusData.class);
    doReturn("distributionId").when(statusData).getDistributionID();
    doReturn("componentName").when(statusData).getComponentName();
    doReturn(DistributionStatusEnum.COMPONENT_DONE_ERROR).when(statusData).getStatus();
    doNothing().when(toscaInstaller).installTheComponentStatus(isA(IStatusData.class));
    statusCallback.activateCallback(statusData);
    verify(toscaInstaller, times(1)).installTheComponentStatus(statusData);
}
Also used : IStatusData(org.onap.sdc.api.notification.IStatusData) BaseTest(org.onap.so.asdc.BaseTest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 IStatusData (org.onap.sdc.api.notification.IStatusData)2 BaseTest (org.onap.so.asdc.BaseTest)2