use of io.cucumber.java.en.Then in project syndesis-qe by syndesisio.
the class ConnectionsPublicApiSteps method checkConnectionProperties.
/**
* DataTable -> | property1 | value |
* | property2 | value |
*/
@Then("^check that (\\w+) connection contains properties$")
public void checkConnectionProperties(String connectionName, DataTable tagsData) {
List<List<String>> connectionProperties = tagsData.cells();
Connection connection = connectionsEndpoint.getConnectionByName(connectionName);
for (List<String> connectionProperty : connectionProperties) {
assertThat(connection.getConfiguredProperties()).containsEntry(connectionProperty.get(0), connectionProperty.get(1));
}
}
use of io.cucumber.java.en.Then in project syndesis-qe by syndesisio.
the class IntegrationsPublicApiSteps method checkState.
@Then("^check that state of the integration (\\w+) is (\\w+)$")
public void checkState(String integrationName, String desiredState) {
if ("Unpublished".equals(desiredState)) {
String integrationId = internalIntegrationsEndpoint.getIntegrationId(integrationName).get();
final IntegrationOverview integrationOverview = integrationOverviewEndpoint.getOverview(integrationId);
TestUtils.waitForUnpublishing(integrationOverviewEndpoint, integrationOverview, TimeUnit.MINUTES, 10);
}
assertThat(integrationsEndpoint.getStateOfIntegration(integrationName).get("currentState").asText()).isEqualTo(desiredState);
}
use of io.cucumber.java.en.Then in project syndesis-qe by syndesisio.
the class UpgradeSteps method checkPullSecret.
@Then("check that pull secret is linked in the service accounts")
public void checkPullSecret() {
boolean found = false;
// If it is present in the server, it was linked to all others needed
for (LocalObjectReference imagePullSecret : OpenShiftUtils.getInstance().getServiceAccount("syndesis-server").getImagePullSecrets()) {
if (imagePullSecret.getName().equals(TestConfiguration.syndesisPullSecretName())) {
found = true;
break;
}
}
assertThat(found).as("The pull secret should be linked to service account, but wasn't").isTrue();
}
use of io.cucumber.java.en.Then in project grakn by graknlabs.
the class TypeQLSteps method answer_groups_are.
@Then("answer groups are")
public void answer_groups_are(List<Map<String, String>> answerIdentifierTable) {
Set<AnswerIdentifierGroup> answerIdentifierGroups = answerIdentifierTable.stream().collect(Collectors.groupingBy(x -> x.get(AnswerIdentifierGroup.GROUP_COLUMN_NAME))).values().stream().map(AnswerIdentifierGroup::new).collect(Collectors.toSet());
assertEquals(String.format("Expected [%d] answer groups, but found [%d].", answerIdentifierGroups.size(), answerGroups.size()), answerIdentifierGroups.size(), answerGroups.size());
for (AnswerIdentifierGroup answerIdentifierGroup : answerIdentifierGroups) {
String[] identifier = answerIdentifierGroup.ownerIdentifier.split(":", 2);
UniquenessCheck checker;
switch(identifier[0]) {
case "label":
checker = new LabelUniquenessCheck(identifier[1]);
break;
case "key":
checker = new KeyUniquenessCheck(identifier[1]);
break;
case "value":
checker = new ValueUniquenessCheck(identifier[1]);
break;
default:
throw new IllegalStateException("Unexpected value: " + identifier[0]);
}
ConceptMapGroup answerGroup = answerGroups.stream().filter(ag -> checker.check(ag.owner())).findAny().orElse(null);
assertNotNull(String.format("The group identifier [%s] does not match any of the answer group owners.", answerIdentifierGroup.ownerIdentifier), answerGroup);
List<Map<String, String>> answersIdentifiers = answerIdentifierGroup.answersIdentifiers;
for (ConceptMap answer : answerGroup.conceptMaps()) {
List<Map<String, String>> matchingIdentifiers = new ArrayList<>();
for (Map<String, String> answerIdentifiers : answersIdentifiers) {
if (matchAnswerConcept(answerIdentifiers, answer)) {
matchingIdentifiers.add(answerIdentifiers);
}
}
assertEquals(String.format("An identifier entry (row) should match 1-to-1 to an answer, but there were [%d] matching identifier entries for answer with variables %s.", matchingIdentifiers.size(), answer.concepts().keySet().toString()), 1, matchingIdentifiers.size());
}
}
}
use of io.cucumber.java.en.Then in project grakn by graknlabs.
the class RelationTypeSteps method relation_type_get_role_type_get_supertype.
@Then("relation\\( ?{type_label} ?) get role\\( ?{type_label} ?) get supertype: {scoped_label}")
public void relation_type_get_role_type_get_supertype(String relationLabel, String roleLabel, Parameters.ScopedLabel superLabel) {
RoleType superType = tx().concepts().getRelationType(superLabel.scope()).getRelates(superLabel.label());
assertEquals(superType, tx().concepts().getRelationType(relationLabel).getRelates(roleLabel).getSupertype());
}
Aggregations