use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.GetAssociationLnObjectsResponse in project open-smart-grid-platform by OSGP.
the class AssociationLnObjects method theObjectlistShouldBeReturned.
@Then("^the objectlist should be returned$")
public void theObjectlistShouldBeReturned(final Map<String, String> settings) throws Throwable {
final GetAssociationLnObjectsAsyncRequest asyncRequest = AssociationLnObjectsRequestFactory.fromScenarioContext();
final GetAssociationLnObjectsResponse response = this.responseClient.getResponse(asyncRequest);
assertThat(response.getResult()).as("Response should be OK").isEqualTo(OsgpResultType.OK);
assertThat(response.getAssociationLnList()).as("Response should contain an AssociationLnList").isNotNull();
assertThat(response.getAssociationLnList().getAssociationLnListElement().get(0)).as("AssociationLnList shoudl have at least one entry").isNotNull();
final AssociationLnListElement element = response.getAssociationLnList().getAssociationLnListElement().get(0);
assertThat(element.getAccessRights()).as("AccessRights should be present").isNotNull();
assertThat(element.getClassId()).as("ClassId should be present").isNotNull();
assertThat(element.getLogicalName()).as("LogicalName should be present").isNotNull();
assertThat(element.getVersion()).as("Version should be present").isNotNull();
assertThat(element.getAccessRights().getAttributeAccess().getAttributeAccessItem().get(0).getAttributeId()).as("AttributeId should be present").isNotNull();
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.GetAssociationLnObjectsResponse in project open-smart-grid-platform by OSGP.
the class SmartMeteringAdhocEndpoint method getAssociationLnObjectsResponse.
@PayloadRoot(localPart = "GetAssociationLnObjectsAsyncRequest", namespace = SMARTMETER_ADHOC_NAMESPACE)
@ResponsePayload
public GetAssociationLnObjectsResponse getAssociationLnObjectsResponse(@RequestPayload final GetAssociationLnObjectsAsyncRequest request) throws OsgpException {
GetAssociationLnObjectsResponse response = null;
try {
response = new GetAssociationLnObjectsResponse();
final ResponseData responseData = this.responseDataService.get(request.getCorrelationUid(), ComponentType.WS_SMART_METERING);
response.setResult(OsgpResultType.fromValue(responseData.getResultType().getValue()));
if (responseData.getMessageData() instanceof AssociationLnListType) {
response.setAssociationLnList(this.adhocMapper.map(responseData.getMessageData(), org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.AssociationLnListType.class));
}
} catch (final Exception e) {
this.handleException(e);
}
return response;
}
Aggregations