use of org.opensmartgridplatform.adapter.ws.schema.core.devicemanagement.Organisation in project open-smart-grid-platform by OSGP.
the class FindOrganizationsSteps method createOrganisation.
private Organisation createOrganisation(final Map<String, String> expectedResult) {
final Organisation expected = new Organisation();
expected.setOrganisationIdentification(getString(expectedResult, PlatformKeys.KEY_ORGANIZATION_IDENTIFICATION, PlatformDefaults.DEFAULT_ORGANIZATION_IDENTIFICATION));
expected.setName(getString(expectedResult, PlatformKeys.KEY_NAME, PlatformDefaults.DEFAULT_ORGANIZATION_NAME));
expected.getDomains().addAll(this.createDomains(expectedResult));
expected.setPrefix(getString(expectedResult, PlatformKeys.KEY_PREFIX, PlatformDefaults.DEFAULT_PREFIX));
return expected;
}
use of org.opensmartgridplatform.adapter.ws.schema.core.devicemanagement.Organisation in project open-smart-grid-platform by OSGP.
the class FindOrganizationsSteps method theGetOrganizationResponseContains.
@Then("^the get organization response contains$")
public void theGetOrganizationResponseContains(final Map<String, String> expectedResult) {
final FindOrganisationResponse response = (FindOrganisationResponse) ScenarioContext.current().get(PlatformCommonKeys.RESPONSE);
final Organisation organisation = response.getOrganisation();
final Organisation expected = this.createOrganisation(expectedResult);
assertThat(this.organisationMatches(expected, organisation)).as("Expected organization \"" + expected.getOrganisationIdentification() + "\" was not found as the organization in the response").isTrue();
}
use of org.opensmartgridplatform.adapter.ws.schema.core.devicemanagement.Organisation in project open-smart-grid-platform by OSGP.
the class FindOrganizationsSteps method theGetAllOrganizationsResponseContains.
@Then("^the get all organizations response contains$")
public void theGetAllOrganizationsResponseContains(final Map<String, String> expectedResult) {
final FindAllOrganisationsResponse response = (FindAllOrganisationsResponse) ScenarioContext.current().get(PlatformCommonKeys.RESPONSE);
final List<Organisation> organisations = response.getOrganisations();
final Organisation expected = this.createOrganisation(expectedResult);
for (final Organisation organisation : organisations) {
if (this.organisationMatches(expected, organisation)) {
return;
}
}
Assertions.fail("Expected organization \"" + expected.getOrganisationIdentification() + "\" was not found as one of the " + organisations.size() + " organizations in the response");
}
Aggregations