use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.DisableDebuggingResponse in project open-smart-grid-platform by OSGP.
the class SmartMeteringManagementEndpoint method getDisableDebuggingResponse.
@PayloadRoot(localPart = "DisableDebuggingAsyncRequest", namespace = NAMESPACE)
@ResponsePayload
public DisableDebuggingResponse getDisableDebuggingResponse(@OrganisationIdentification final String organisationIdentification, @RequestPayload final DisableDebuggingAsyncRequest request) throws OsgpException {
log.info("DisableDebugging response for organisation: {} and device: {}.", organisationIdentification, request.getDeviceIdentification());
DisableDebuggingResponse response = null;
try {
response = new DisableDebuggingResponse();
final ResponseData responseData = this.responseDataService.get(request.getCorrelationUid(), ComponentType.WS_SMART_METERING);
this.throwExceptionIfResultNotOk(responseData, "Disable Debugging");
response.setResult(OsgpResultType.fromValue(responseData.getResultType().getValue()));
if (responseData.getMessageData() instanceof String) {
response.setDescription((String) responseData.getMessageData());
}
} catch (final ConstraintViolationException e) {
throw new FunctionalException(FunctionalExceptionType.VALIDATION_ERROR, ComponentType.WS_SMART_METERING, new ValidationException(e.getConstraintViolations()));
} catch (final Exception e) {
this.handleException(e);
}
return response;
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.DisableDebuggingResponse in project open-smart-grid-platform by OSGP.
the class EnableAndDisableDebugging method theDisableDebugResponseShouldBe.
@Then("^the disable debug response should be \"([^\"]*)\"$")
public void theDisableDebugResponseShouldBe(final String result) throws Throwable {
final DisableDebuggingAsyncRequest disableDebuggingAsyncRequest = DisableDebuggingRequestFactory.fromScenarioContext();
final DisableDebuggingResponse disableDebuggingResponse = this.smartMeteringManagementResponseClientDisableDebugging.getResponse(disableDebuggingAsyncRequest);
assertThat(disableDebuggingResponse).as("DisableDebugRequestResponse should not be null").isNotNull();
assertThat(disableDebuggingResponse.getResult()).as("Expected result").isNotNull();
}
Aggregations