Search in sources :

Example 1 with GetAssociationLnObjectsAsyncRequest

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.GetAssociationLnObjectsAsyncRequest 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();
}
Also used : AssociationLnListElement(org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.AssociationLnListElement) GetAssociationLnObjectsAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.GetAssociationLnObjectsAsyncRequest) GetAssociationLnObjectsResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.GetAssociationLnObjectsResponse) Then(io.cucumber.java.en.Then)

Example 2 with GetAssociationLnObjectsAsyncRequest

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.GetAssociationLnObjectsAsyncRequest in project open-smart-grid-platform by OSGP.

the class AssociationLnObjectsRequestFactory method fromScenarioContext.

public static GetAssociationLnObjectsAsyncRequest fromScenarioContext() {
    final GetAssociationLnObjectsAsyncRequest asyncRequest = new GetAssociationLnObjectsAsyncRequest();
    asyncRequest.setCorrelationUid(RequestFactoryHelper.getCorrelationUidFromScenarioContext());
    asyncRequest.setDeviceIdentification(RequestFactoryHelper.getDeviceIdentificationFromScenarioContext());
    return asyncRequest;
}
Also used : GetAssociationLnObjectsAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.GetAssociationLnObjectsAsyncRequest)

Aggregations

GetAssociationLnObjectsAsyncRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.GetAssociationLnObjectsAsyncRequest)2 Then (io.cucumber.java.en.Then)1 AssociationLnListElement (org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.AssociationLnListElement)1 GetAssociationLnObjectsResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.GetAssociationLnObjectsResponse)1