use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SetPushSetupSmsAsyncRequest in project open-smart-grid-platform by OSGP.
the class SetPushSetupSmsRequestFactory method fromScenarioContext.
public static SetPushSetupSmsAsyncRequest fromScenarioContext() {
final SetPushSetupSmsAsyncRequest asyncRequest = new SetPushSetupSmsAsyncRequest();
asyncRequest.setCorrelationUid(RequestFactoryHelper.getCorrelationUidFromScenarioContext());
asyncRequest.setDeviceIdentification(RequestFactoryHelper.getDeviceIdentificationFromScenarioContext());
return asyncRequest;
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SetPushSetupSmsAsyncRequest in project open-smart-grid-platform by OSGP.
the class SetPushSetupSms method thePushSetupSmsShouldBeSetOnTheDevice.
@Then("^the PushSetupSms should be set on the device$")
public void thePushSetupSmsShouldBeSetOnTheDevice(final Map<String, String> settings) throws Throwable {
final SetPushSetupSmsAsyncRequest setPushSetupSmsAsyncRequest = SetPushSetupSmsRequestFactory.fromScenarioContext();
final SetPushSetupSmsResponse setPushSetupSmsResponse = this.smartMeteringConfigurationClient.getSetPushSetupSmsResponse(setPushSetupSmsAsyncRequest);
assertThat(setPushSetupSmsResponse).as("SetPushSetupSmsResponse was null").isNotNull();
assertThat(setPushSetupSmsResponse.getResult()).as("SetPushSetupSmsResponse result was null").isNotNull();
assertThat(setPushSetupSmsResponse.getResult()).as("SetPushSetupSmsResponse should be OK").isEqualTo(OsgpResultType.OK);
final GetSpecificAttributeValueResponse specificAttributeValues = this.getSpecificAttributeValues(settings);
assertThat(specificAttributeValues).as("GetSpecificAttributeValuesResponse was null").isNotNull();
assertThat(specificAttributeValues.getResult()).as("GetSpecificAttributeValuesResponse result was null").isNotNull();
assertThat(specificAttributeValues.getResult()).as("GetSpecificAttributeValuesResponse should be OK").isEqualTo(OsgpResultType.OK);
final String hostAndPort = ScenarioContext.current().get(PlatformSmartmeteringKeys.HOSTNAME) + ":" + ScenarioContext.current().get(PlatformSmartmeteringKeys.PORT);
final byte[] expectedBytes = (hostAndPort.getBytes(StandardCharsets.US_ASCII));
final String expected = Arrays.toString(expectedBytes);
final String actual = specificAttributeValues.getAttributeValueData();
assertThat(actual.contains(expected)).as("PushSetupSms was not set on device").isTrue();
}
Aggregations