use of org.opensmartgridplatform.domain.core.valueobjects.smartmetering.GetConfigurationObjectResponse in project open-smart-grid-platform by OSGP.
the class ConfigurationService method handleGetConfigurationObjectResponse.
public void handleGetConfigurationObjectResponse(final MessageMetadata messageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception, final GetConfigurationObjectResponseDto resultData) {
log.info("handle GetConfigurationObject response for MessageType: {}", messageMetadata.getMessageType());
final GetConfigurationObjectResponse response = this.configurationMapper.map(resultData, GetConfigurationObjectResponse.class);
ResponseMessageResultType result = deviceResult;
if (exception != null) {
log.error(DEVICE_RESPONSE_NOT_OK_LOG_MSG, exception);
result = ResponseMessageResultType.NOT_OK;
}
final ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder().withMessageMetadata(messageMetadata).withResult(result).withOsgpException(exception).withDataObject(response).build();
this.webServiceResponseMessageSender.send(responseMessage, messageMetadata.getMessageType());
}
use of org.opensmartgridplatform.domain.core.valueobjects.smartmetering.GetConfigurationObjectResponse in project open-smart-grid-platform by OSGP.
the class GetConfigurationObjectResponseMappingTest method testMapGetConfigurationObjectResponseDto.
@Test
public void testMapGetConfigurationObjectResponseDto() {
final GetConfigurationObjectResponseDto dto = this.makeGetConfigurationObjectResponseDto();
final GetConfigurationObjectResponse result = this.mapper.map(dto, GetConfigurationObjectResponse.class);
assertThat(result).withFailMessage("mapping GetConfigurationObjectResponseDto should not return null").isNotNull();
assertThat(result).withFailMessage("mapping GetConfigurationObjectResponseDto should return correct type").isOfAnyClassIn(GetConfigurationObjectResponse.class);
}
Aggregations