use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetKeysAsyncRequest in project open-smart-grid-platform by OSGP.
the class GetKeys method theGetKeysResponseIsReturned.
@Then("^the get keys response should return the requested keys$")
public void theGetKeysResponseIsReturned(final Map<String, String> expectedValues) throws Throwable {
final GetKeysAsyncRequest asyncRequest = GetKeysRequestFactory.fromScenarioContext();
final GetKeysResponse response = this.smartMeteringConfigurationClient.retrieveGetKeysResponse(asyncRequest);
assertThat(response).isNotNull();
assertThat(response.getResult()).as(OPERATION + ", Checking result:").isEqualTo(OsgpResultType.OK);
final List<GetKeysResponseData> responseDataList = response.getGetKeysResponseData();
assertThat(responseDataList).noneMatch(getKeysResponseData -> ArrayUtils.isEmpty(getKeysResponseData.getSecretValue()));
final List<SecretType> secretTypesInResponse = responseDataList.stream().map(GetKeysResponseData::getSecretType).collect(Collectors.toList());
final List<SecretType> expectedSecretTypes = getSecretTypesFromParameterMap(expectedValues);
assertThat(secretTypesInResponse).containsExactlyInAnyOrderElementsOf(expectedSecretTypes);
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetKeysAsyncRequest in project open-smart-grid-platform by OSGP.
the class GetKeysRequestFactory method fromScenarioContext.
public static GetKeysAsyncRequest fromScenarioContext() {
final GetKeysAsyncRequest asyncRequest = new GetKeysAsyncRequest();
asyncRequest.setCorrelationUid(RequestFactoryHelper.getCorrelationUidFromScenarioContext());
asyncRequest.setDeviceIdentification(RequestFactoryHelper.getDeviceIdentificationFromScenarioContext());
return asyncRequest;
}
Aggregations