-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup the keycloak standalone server for testing.
Handle keycloak user roles update, delete interactions through saga. Fix database connection closed issue and functional tests
- Loading branch information
1 parent
a15a3c6
commit de0dc51
Showing
32 changed files
with
717 additions
and
140 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
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
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
7 changes: 7 additions & 0 deletions
7
...a/engineering/everest/lhotse/axon/common/exceptions/KeycloakSynchronizationException.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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package engineering.everest.lhotse.axon.common.exceptions; | ||
|
||
public class KeycloakSynchronizationException extends RuntimeException { | ||
public KeycloakSynchronizationException(String message) { | ||
super(message); | ||
} | ||
} |
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
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 |
---|---|---|
@@ -1,11 +1,12 @@ | ||
buildscript { | ||
repositories { | ||
jcenter() | ||
mavenCentral() | ||
} | ||
} | ||
|
||
plugins { | ||
id 'org.springframework.boot' | ||
id "de.undercouch.download" version "${undercouchVersion}" | ||
} | ||
|
||
apply plugin: 'jacoco' | ||
|
@@ -85,3 +86,36 @@ dependencyManagement { | |
mavenBom "org.keycloak.bom:keycloak-adapter-bom:${keycloakVersion}" | ||
} | ||
} | ||
|
||
task downloadKeycloakZipFile(type: Download) { | ||
src "https://github.com/keycloak/keycloak/releases/download/${keycloakTestServerVersion}/keycloak-${keycloakTestServerVersion}.zip" | ||
dest new File(buildDir, "keycloak-${keycloakTestServerVersion}.zip") | ||
onlyIfModified true | ||
} | ||
|
||
task downloadAndUnzipKeycloakFile(dependsOn: downloadKeycloakZipFile, type: Copy) { | ||
from zipTree(downloadKeycloakZipFile.dest) | ||
into buildDir | ||
} | ||
|
||
task startServer(dependsOn: 'downloadAndUnzipKeycloakFile') { | ||
doLast { | ||
def keycloakDir = "$buildDir/keycloak-${keycloakTestServerVersion}" | ||
def port = 8180 | ||
def waitTime = 10000 | ||
def testUser = "[email protected]" | ||
def testPass = "ac0n3x72" | ||
|
||
def createUser = "$keycloakDir/bin/add-user-keycloak.sh -r master -u $testUser -p $testPass".execute() | ||
createUser.consumeProcessOutput(System.out, System.err) | ||
createUser.waitForOrKill(waitTime) | ||
|
||
def startServer = "$keycloakDir/bin/standalone.sh -Djboss.http.port=$port".execute() | ||
startServer.consumeProcessOutput(System.out, System.err) | ||
startServer.waitForOrKill(3 * waitTime) | ||
|
||
def createRealm = "$keycloakDir/bin/kcadm.sh create realms -f $rootDir/imports/realm-export.json --no-config --server http://localhost:$port/auth --realm master --user $testUser --password $testPass".execute() | ||
createRealm.consumeProcessOutput(System.out, System.err) | ||
createRealm.waitForOrKill(waitTime) | ||
} | ||
} |
Oops, something went wrong.