Search in sources :

Example 1 with JsonStatusData

use of org.onap.so.asdc.client.test.emulators.JsonStatusData in project so by onap.

the class ASDCStatusCallBackTest method activateCallbackTest.

@Test
public void activateCallbackTest() throws Exception {
    JsonStatusData statusData = new JsonStatusData();
    doNothing().when(toscaInstaller).installTheComponentStatus(isA(JsonStatusData.class));
    statusCallback.activateCallback(statusData);
    verify(toscaInstaller, times(1)).installTheComponentStatus(statusData);
}
Also used : JsonStatusData(org.onap.so.asdc.client.test.emulators.JsonStatusData) BaseTest(org.onap.so.asdc.BaseTest) Test(org.junit.Test)

Example 2 with JsonStatusData

use of org.onap.so.asdc.client.test.emulators.JsonStatusData in project so by onap.

the class ASDCRestInterface method invokeASDCStatusData.

@POST
@Path("/statusData/v1")
@Produces(MediaType.APPLICATION_JSON)
@Transactional
public Response invokeASDCStatusData(final String request) {
    try {
        final DistributionClientEmulator distributionClientEmulator = getDistributionClientEmulator("resource-examples/");
        final JsonStatusData statusData = JsonStatusData.instantiateNotifFromJsonFile("resource-examples/");
        asdcController.setDistributionClient(distributionClientEmulator);
        asdcController.initASDC();
        toscaInstaller.installTheComponentStatus(statusData);
        asdcController.closeASDC();
        logger.info(LoggingAnchor.FOUR, MessageEnum.ASDC_ARTIFACT_DEPLOY_SUC.toString(), statusData.getDistributionID(), "ASDC", "ASDC Updates Are Complete");
    } catch (final Exception e) {
        logger.info("Error caught " + e.getMessage());
        logger.error(LoggingAnchor.SIX, MessageEnum.ASDC_GENERAL_EXCEPTION.toString(), "Exception caught during ASDCRestInterface", "ASDC", "invokeASDCService", ErrorCode.BusinessProcessError.getValue(), "Exception in invokeASDCService", e);
    }
    return null;
}
Also used : JsonStatusData(org.onap.so.asdc.client.test.emulators.JsonStatusData) DistributionClientEmulator(org.onap.so.asdc.client.test.emulators.DistributionClientEmulator) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST) Produces(javax.ws.rs.Produces) Transactional(javax.transaction.Transactional)

Example 3 with JsonStatusData

use of org.onap.so.asdc.client.test.emulators.JsonStatusData in project so by onap.

the class ToscaResourceInstallerTest method before.

@Before
public void before() {
    MockitoAnnotations.initMocks(this);
    notificationData = new NotificationDataImpl();
    statusData = new JsonStatusData();
}
Also used : JsonStatusData(org.onap.so.asdc.client.test.emulators.JsonStatusData) NotificationDataImpl(org.onap.so.asdc.client.test.emulators.NotificationDataImpl) Before(org.junit.Before)

Aggregations

JsonStatusData (org.onap.so.asdc.client.test.emulators.JsonStatusData)3 Transactional (javax.transaction.Transactional)1 POST (javax.ws.rs.POST)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1 Before (org.junit.Before)1 Test (org.junit.Test)1 BaseTest (org.onap.so.asdc.BaseTest)1 DistributionClientEmulator (org.onap.so.asdc.client.test.emulators.DistributionClientEmulator)1 NotificationDataImpl (org.onap.so.asdc.client.test.emulators.NotificationDataImpl)1