use of org.opensmartgridplatform.adapter.ws.schema.publiclighting.adhocmanagement.ResumeScheduleResponse in project open-smart-grid-platform by OSGP.
the class ResumeScheduleSteps method getResponseWithCorrelationUID.
private ResumeScheduleResponse getResponseWithCorrelationUID(final String deviceIdentification, final String correlationUID) throws InterruptedException, SoapFaultClientException {
final ResumeScheduleAsyncRequest request = new ResumeScheduleAsyncRequest();
final AsyncRequest asyncRequest = new AsyncRequest();
asyncRequest.setDeviceId(deviceIdentification);
asyncRequest.setCorrelationUid(correlationUID);
request.setAsyncRequest(asyncRequest);
return Wait.untilAndReturn(() -> {
final ResumeScheduleResponse retval = this.client.getResumeScheduleResponse(request);
assertThat(retval).isNotNull();
return retval;
});
}
use of org.opensmartgridplatform.adapter.ws.schema.publiclighting.adhocmanagement.ResumeScheduleResponse in project open-smart-grid-platform by OSGP.
the class PublicLightingAdHocManagementEndpoint method getResumeScheduleResponse.
@PayloadRoot(localPart = "ResumeScheduleAsyncRequest", namespace = NAMESPACE)
@ResponsePayload
public ResumeScheduleResponse getResumeScheduleResponse(@OrganisationIdentification final String organisationIdentification, @RequestPayload final ResumeScheduleAsyncRequest request) throws OsgpException {
LOGGER.info("Resume Schedule Async Request received from organisation: {} for device: {}.", organisationIdentification, request.getAsyncRequest().getDeviceId());
final ResumeScheduleResponse response = new ResumeScheduleResponse();
try {
final ResponseMessage message = this.adHocManagementService.dequeueResumeScheduleResponse(request.getAsyncRequest().getCorrelationUid());
if (message != null) {
response.setResult(OsgpResultType.fromValue(message.getResult().getValue()));
}
} catch (final Exception e) {
this.handleException(e);
}
return response;
}
use of org.opensmartgridplatform.adapter.ws.schema.publiclighting.adhocmanagement.ResumeScheduleResponse in project open-smart-grid-platform by OSGP.
the class ResumeScheduleSteps method thenThePlatformBuffersAResumeScheduleResponseMessage.
@Then("^the platform buffers a resume schedule response message for device \"([^\"]*)\"$")
public void thenThePlatformBuffersAResumeScheduleResponseMessage(final String deviceIdentification, final Map<String, String> expectedResult) throws Throwable {
Wait.until(() -> {
ResumeScheduleResponse response = null;
try {
response = this.getResponseWithCorrelationUID(deviceIdentification, (String) ScenarioContext.current().get(PlatformPubliclightingKeys.KEY_CORRELATION_UID));
} catch (final Exception e) {
// do nothing
}
assertThat(response).isNotNull();
assertThat(response.getResult()).isEqualTo(Enum.valueOf(OsgpResultType.class, expectedResult.get(PlatformPubliclightingKeys.KEY_RESULT)));
});
}
Aggregations