use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetAdministrativeStatusRequest in project open-smart-grid-platform by OSGP.
the class GetAdministrativeStatus method theRetrieveAdministrativeStatusRequestIsReceivedForDevices.
@When("^the get administrative status request is received for devices$")
public void theRetrieveAdministrativeStatusRequestIsReceivedForDevices(final List<String> deviceIdentifications) throws Throwable {
final Map<String, String> parameterMap = new HashMap<>();
final Map<String, String> correlationUidMap = new HashMap<>();
for (final String deviceIdentification : deviceIdentifications) {
parameterMap.put(PlatformKeys.KEY_DEVICE_IDENTIFICATION, deviceIdentification);
final GetAdministrativeStatusRequest getAdministrativeStatusRequest = GetAdministrativeStatusRequestFactory.fromParameterMap(parameterMap);
final GetAdministrativeStatusAsyncResponse getAdministrativeStatusAsyncResponse = this.smartMeteringConfigurationClient.getAdministrativeStatus(getAdministrativeStatusRequest);
assertThat(getAdministrativeStatusAsyncResponse).as("Get administrative status asyncResponse should not be null").isNotNull();
correlationUidMap.put(deviceIdentification, getAdministrativeStatusAsyncResponse.getCorrelationUid());
}
ScenarioContext.current().put(CORRELATION_UID_BY_DEVICE_IDENTIFICATION, correlationUidMap);
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetAdministrativeStatusRequest in project open-smart-grid-platform by OSGP.
the class AddDeviceSteps method aRequestToTheDeviceCanBePerformedAfterActivation.
@Then("^a request to the device can be performed after activation$")
public void aRequestToTheDeviceCanBePerformedAfterActivation() throws Throwable {
final Device device = this.activateDevice();
/*
* Fire any request that causes communication to the device, and check
* that the actual response is not an error.
*/
final GetAdministrativeStatusRequest request = new GetAdministrativeStatusRequest();
request.setDeviceIdentification(device.getDeviceIdentification());
final GetAdministrativeStatusAsyncResponse getAdministrativeStatusAsyncResponse = this.smartMeteringConfigurationClient.getAdministrativeStatus(request);
final GetAdministrativeStatusAsyncRequest asyncRequest = new GetAdministrativeStatusAsyncRequest();
asyncRequest.setCorrelationUid(getAdministrativeStatusAsyncResponse.getCorrelationUid());
asyncRequest.setDeviceIdentification(device.getDeviceIdentification());
final GetAdministrativeStatusResponse getAdministrativeStatusResponse = this.smartMeteringConfigurationClient.retrieveGetAdministrativeStatusResponse(asyncRequest);
assertThat(getAdministrativeStatusResponse.getEnabled()).as("Administrative status should contain information if it is enabled").isNotNull();
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetAdministrativeStatusRequest in project open-smart-grid-platform by OSGP.
the class GetAdministrativeStatusRequestFactory method fromParameterMap.
public static GetAdministrativeStatusRequest fromParameterMap(final Map<String, String> requestParameters) {
final GetAdministrativeStatusRequest getAdministrativeStatusRequest = new GetAdministrativeStatusRequest();
getAdministrativeStatusRequest.setDeviceIdentification(requestParameters.get(PlatformSmartmeteringKeys.KEY_DEVICE_IDENTIFICATION));
return getAdministrativeStatusRequest;
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetAdministrativeStatusRequest in project open-smart-grid-platform by OSGP.
the class GetAdministrativeStatus method theRetrieveAdministrativeStatusRequestIsReceived.
@When("^the get administrative status request is received$")
public void theRetrieveAdministrativeStatusRequestIsReceived(final Map<String, String> requestData) throws Throwable {
final GetAdministrativeStatusRequest getAdministrativeStatusRequest = GetAdministrativeStatusRequestFactory.fromParameterMap(requestData);
final GetAdministrativeStatusAsyncResponse getAdministrativeStatusAsyncResponse = this.smartMeteringConfigurationClient.getAdministrativeStatus(getAdministrativeStatusRequest);
LOGGER.info("Get administrative status asyncResponse is received {}", getAdministrativeStatusAsyncResponse);
assertThat(getAdministrativeStatusAsyncResponse).as("Get administrative status asyncResponse should not be null").isNotNull();
ScenarioContext.current().put(PlatformKeys.KEY_CORRELATION_UID, getAdministrativeStatusAsyncResponse.getCorrelationUid());
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetAdministrativeStatusRequest in project open-smart-grid-platform by OSGP.
the class FunctionalExceptionsSteps method theRetrieveAdministrativeStatusRequestForAnInvalidOrganisationIsReceived.
@When("^the get administrative status request for an invalid organisation is received$")
public void theRetrieveAdministrativeStatusRequestForAnInvalidOrganisationIsReceived(final Map<String, String> requestData) throws Throwable {
final GetAdministrativeStatusRequest getAdministrativeStatusRequest = GetAdministrativeStatusRequestFactory.fromParameterMap(requestData);
if (requestData.containsKey(PlatformKeys.KEY_ORGANIZATION_IDENTIFICATION)) {
final String organisation = getString(requestData, PlatformKeys.KEY_ORGANIZATION_IDENTIFICATION);
ScenarioContext.current().put(PlatformKeys.KEY_ORGANIZATION_IDENTIFICATION, organisation);
}
try {
this.smartMeteringConfigurationClient.getAdministrativeStatus(getAdministrativeStatusRequest);
} catch (final Exception exception) {
ScenarioContext.current().put(PlatformKeys.RESPONSE, exception);
}
}
Aggregations