forked from keycloak/keycloak
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KEYCLOAK-9712 KEYCLOAK-9911 moved Javascript adater tests and LoginMo…
…dulesTest outsite of adapter package
- Loading branch information
Showing
6 changed files
with
14 additions
and
17 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,21 +15,18 @@ | |
* limitations under the License. | ||
*/ | ||
|
||
package org.keycloak.testsuite.adapter.jaas; | ||
package org.keycloak.testsuite.jaas; | ||
|
||
import java.io.File; | ||
import java.io.FileInputStream; | ||
import java.io.FileNotFoundException; | ||
import java.io.FileOutputStream; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.io.PrintWriter; | ||
import java.lang.invoke.MethodHandles; | ||
import java.net.URI; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.Scanner; | ||
import java.util.Set; | ||
|
||
import javax.security.auth.Subject; | ||
|
@@ -46,6 +43,7 @@ | |
import com.fasterxml.jackson.databind.JsonNode; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
|
||
import org.junit.AfterClass; | ||
import org.junit.Assume; | ||
import org.junit.Before; | ||
import org.junit.BeforeClass; | ||
|
@@ -90,13 +88,20 @@ public void addTestRealms(List<RealmRepresentation> testRealms) { | |
testRealms.add(IOUtil.loadRealm("/adapter-test/demorealm.json")); | ||
} | ||
|
||
private static void enabled() { | ||
Assume.assumeTrue(AUTH_SERVER_SSL_REQUIRED); | ||
} | ||
|
||
@BeforeClass | ||
public static void createTemporaryFiles() throws Exception { | ||
enabled(); | ||
|
||
copyContentAndReplaceAuthServerAddress(new File(DIRECT_GRANT_CONFIG), DIRECT_GRANT_CONFIG_FILE); | ||
copyContentAndReplaceAuthServerAddress(new File(BEARER_CONFIG), BEARER_CONFIG_FILE); | ||
} | ||
|
||
public void removeTemporaryFiles() { | ||
@AfterClass | ||
public static void removeTemporaryFiles() { | ||
DIRECT_GRANT_CONFIG_FILE.deleteOnExit(); | ||
BEARER_CONFIG_FILE.deleteOnExit(); | ||
} | ||
|
@@ -127,10 +132,6 @@ public void generateAudienceClientScope() { | |
|
||
@Test | ||
public void testDirectAccessGrantLoginModuleLoginFailed() throws Exception { | ||
Assume.assumeTrue(AUTH_SERVER_SSL_REQUIRED); | ||
|
||
|
||
|
||
LoginContext loginContext = new LoginContext("does-not-matter", null, | ||
createJaasCallbackHandler("[email protected]", "bad-password"), | ||
createJaasConfigurationForDirectGrant(null)); | ||
|
@@ -146,7 +147,6 @@ public void testDirectAccessGrantLoginModuleLoginFailed() throws Exception { | |
|
||
@Test | ||
public void testDirectAccessGrantLoginModuleLoginSuccess() throws Exception { | ||
Assume.assumeTrue(AUTH_SERVER_SSL_REQUIRED); | ||
oauth.realm("demo"); | ||
|
||
LoginContext loginContext = directGrantLogin(null); | ||
|
@@ -169,7 +169,6 @@ public void testDirectAccessGrantLoginModuleLoginSuccess() throws Exception { | |
|
||
@Test | ||
public void testBearerLoginFailedLogin() throws Exception { | ||
Assume.assumeTrue(AUTH_SERVER_SSL_REQUIRED); | ||
oauth.realm("demo"); | ||
|
||
LoginContext directGrantCtx = directGrantLogin(null); | ||
|
@@ -194,7 +193,6 @@ public void testBearerLoginFailedLogin() throws Exception { | |
|
||
@Test | ||
public void testBearerLoginSuccess() throws Exception { | ||
Assume.assumeTrue(AUTH_SERVER_SSL_REQUIRED); | ||
oauth.realm("demo"); | ||
|
||
LoginContext directGrantCtx = directGrantLogin("customer-db-audience-required"); | ||
|
2 changes: 1 addition & 1 deletion
2
...er/javascript/AbstractJavascriptTest.java → ...te/javascript/AbstractJavascriptTest.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
2 changes: 1 addition & 1 deletion
2
...ter/javascript/JavascriptAdapterTest.java → ...ite/javascript/JavascriptAdapterTest.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
2 changes: 1 addition & 1 deletion
2
...ascriptAdapterWithNativePromisesTest.java → ...ascriptAdapterWithNativePromisesTest.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
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