Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KEYCLOAK-2906 Migrate forms package to new testsuite
- Loading branch information
Showing
25 changed files
with
953 additions
and
810 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
...tegration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/drone/Different.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,38 @@ | |||
/* | |||
* Copyright 2016 Red Hat Inc. and/or its affiliates and other contributors | |||
* as indicated by the @author tags. All rights reserved. | |||
* | |||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | |||
* use this file except in compliance with the License. You may obtain a copy of | |||
* the License at | |||
* | |||
* http://www.apache.org/licenses/LICENSE-2.0 | |||
* | |||
* Unless required by applicable law or agreed to in writing, software | |||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | |||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | |||
* License for the specific language governing permissions and limitations under | |||
* the License. | |||
*/ | |||
|
|||
package org.keycloak.testsuite.drone; | |||
|
|||
import java.lang.annotation.ElementType; | |||
import java.lang.annotation.Retention; | |||
import java.lang.annotation.RetentionPolicy; | |||
import java.lang.annotation.Target; | |||
|
|||
import org.jboss.arquillian.drone.api.annotation.Qualifier; | |||
|
|||
/** | |||
* Taken from Drone example https://docs.jboss.org/author/display/ARQ/Drone | |||
* This allows you to have more than one instance of a Drone WebDriver. | |||
* | |||
* @author Stan Silvert ssilvert@redhat.com (C) 2016 Red Hat Inc. | |||
*/ | |||
|
|||
@Retention(RetentionPolicy.RUNTIME) | |||
@Target({ ElementType.FIELD, ElementType.PARAMETER }) | |||
@Qualifier | |||
public @interface Different { | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...on-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/AbstractFlowTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,42 @@ | |||
/* | |||
* Copyright 2016 Red Hat Inc. and/or its affiliates and other contributors | |||
* as indicated by the @author tags. All rights reserved. | |||
* | |||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | |||
* use this file except in compliance with the License. You may obtain a copy of | |||
* the License at | |||
* | |||
* http://www.apache.org/licenses/LICENSE-2.0 | |||
* | |||
* Unless required by applicable law or agreed to in writing, software | |||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | |||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | |||
* License for the specific language governing permissions and limitations under | |||
* the License. | |||
*/ | |||
|
|||
package org.keycloak.testsuite.forms; | |||
|
|||
import org.keycloak.representations.idm.AuthenticationFlowRepresentation; | |||
import org.keycloak.representations.idm.RealmRepresentation; | |||
import org.keycloak.testsuite.TestRealmKeycloakTest; | |||
|
|||
/** | |||
* @author Stan Silvert ssilvert@redhat.com (C) 2016 Red Hat Inc. | |||
*/ | |||
public abstract class AbstractFlowTest extends TestRealmKeycloakTest { | |||
|
|||
protected AuthenticationFlowRepresentation findFlowByAlias(String alias) { | |||
for (AuthenticationFlowRepresentation rep : testRealm().flows().getFlows()) { | |||
if (rep.getAlias().equals(alias)) return rep; | |||
} | |||
|
|||
return null; | |||
} | |||
|
|||
protected void setRegistrationFlow(AuthenticationFlowRepresentation flow) { | |||
RealmRepresentation realm = testRealm().toRepresentation(); | |||
realm.setRegistrationFlow(flow.getAlias()); | |||
testRealm().update(realm); | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.