Search in sources :

Example 1 with SecretType

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SecretType 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);
}
Also used : GetKeysResponseData(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetKeysResponseData) SecretType(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SecretType) GetKeysAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetKeysAsyncRequest) GetKeysResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetKeysResponse) Then(io.cucumber.java.en.Then)

Aggregations

Then (io.cucumber.java.en.Then)1 GetKeysAsyncRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetKeysAsyncRequest)1 GetKeysResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetKeysResponse)1 GetKeysResponseData (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetKeysResponseData)1 SecretType (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SecretType)1