use of org.keycloak.representations.idm.AuthenticationFlowRepresentation in project keycloak by keycloak.
the class FlowsTest method createDeleteExecutionTest.
@Test
public void createDeleteExecutionTest() {
// Adding new execution within testFlow
flowsPage.clickNew();
createFlowPage.form().setValues("testFlow", "testDesc", CreateFlowForm.FlowType.GENERIC);
flowsPage.clickAddExecution();
createExecutionPage.form().selectProviderOption(CreateExecutionForm.ProviderOption.RESET_PASSWORD);
createExecutionPage.form().save();
assertAlertSuccess();
// REST
AuthenticationFlowRepresentation flowRest = getFlowFromREST("testFlow");
assertEquals(1, flowRest.getAuthenticationExecutions().size());
assertEquals("reset-password", flowRest.getAuthenticationExecutions().get(0).getAuthenticator());
// UI
assertEquals("TestFlow", flowsPage.getFlowSelectValue());
assertEquals(1, flowsPage.table().getFlowsAliasesWithRequirements().size());
assertTrue(flowsPage.table().getFlowsAliasesWithRequirements().keySet().contains("Reset Password"));
// Deletion
flowsPage.clickDelete();
modalDialog.confirmDeletion();
assertAlertSuccess();
assertThat(flowsPage.getFlowAllValues(), not(hasItem("TestFlow")));
}
use of org.keycloak.representations.idm.AuthenticationFlowRepresentation in project keycloak by keycloak.
the class FlowsTest method createDeleteFlowTest.
@Test
public void createDeleteFlowTest() {
// Adding new flow
flowsPage.clickNew();
createFlowPage.form().setValues("testFlow", "testDesc", CreateFlowForm.FlowType.GENERIC);
assertAlertSuccess();
// Checking if test flow is created via rest
AuthenticationFlowRepresentation testFlow = getFlowFromREST("testFlow");
assertEquals("testFlow", testFlow.getAlias());
// Checking if testFlow is selected in UI
assertEquals("TestFlow", flowsPage.getFlowSelectValue());
// Adding new execution flow within testFlow
flowsPage.clickAddFlow();
createFlowPage.form().setValues("testExecution", "executionDesc", CreateFlowForm.FlowType.GENERIC);
assertAlertSuccess();
// Checking if execution flow is created via rest
testFlow = getFlowFromREST("testFlow");
assertEquals("testExecution", testFlow.getAuthenticationExecutions().get(0).getFlowAlias());
// Checking if testFlow is selected in UI
assertEquals("TestFlow", flowsPage.getFlowSelectValue());
// Deleting test flow
flowsPage.clickDelete();
modalDialog.confirmDeletion();
assertAlertSuccess();
// Checking if both test flow and execution flow is removed via UI
assertThat(flowsPage.getFlowAllValues(), not(hasItem("TestFlow")));
// Checking if both test flow and execution flow is removed via rest
assertThat(testRealmResource().flows().getFlows(), not(hasItem(testFlow)));
}
Aggregations