Skip to content
Snippets Groups Projects
Verified Commit 2355a5cb authored by Ira ¯\_(ツ)_/¯'s avatar Ira ¯\_(ツ)_/¯
Browse files

Add initial integration testing setup

parent 7c0895f6
No related branches found
No related tags found
No related merge requests found
package org.archlinux.keycloak.mailpass.rest;
import com.palantir.docker.compose.DockerComposeRule;
import org.junit.ClassRule;
import org.junit.Test;
import io.restassured.response.Response;
import static io.restassured.RestAssured.given;
import static io.restassured.RestAssured.post;
import static org.junit.Assert.assertEquals;
public class MailPassResourceIntegrationTest {
private final static String ROOT_URI = "http://localhost:8080/auth/realms/master/mailpass/roleauth";
@ClassRule
public static DockerComposeRule docker = DockerComposeRule.builder()
.file("src/integrationTest/resources/docker-compose.yml").build();
@Test
public void testNonAuthenticatedAccess() {
Response response = post(ROOT_URI + "/compute-password-hash");
assertEquals(401, response.getStatusCode());
}
}
version: '3.8'
services:
keycloak:
container_name: keycloak
build: ./docker
environment:
KEYCLOAK_USER: admin
KEYCLOAK_PASSWORD: admin
JAVA_OPTS: -Dkeycloak.profile=preview
ports:
- 8080:8080
healthcheck:
test: ["CMD-SHELL", "curl http://localhost:8080/auth/realms/master"]
interval: 30s
timeout: 10s
retries: 10
start_period: 1m
FROM jboss/keycloak:latest
COPY ./keycloak-mailpass-rest-1.0.0.jar /opt/jboss/keycloak/standalone/deployments/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment