progressing

This commit is contained in:
Jottyfan
2022-12-07 21:04:30 +01:00
parent f37e4498e8
commit 6aaf6dbeb4
2 changed files with 41 additions and 22 deletions

View File

@ -3,28 +3,24 @@ package de.jottyfan.camporganizer.module.registration;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.keycloak.admin.client.resource.UsersResource;
import org.keycloak.representations.idm.UserRepresentation;
/**
*
* @author jotty
*
*/
@RunWith(SpringRunner.class)
@SpringBootTest
public class TestKeycloakRepository {
@Autowired
private KeycloakRepository repository;
/**
* test registration
*/
@Test
public void testRegister() {
assertTrue(repository.register("Hans", "Dampf", "jottyfan@mail.de"));
KeycloakRepository repository = new KeycloakRepository();
UserRepresentation user = repository.getUserRepresentation("Hans", "Dampf", "hans@dampf.org");
UsersResource resource = repository.getUsersResource("http://localhost:8080", "ow", "admin", "password", "biblecamp");
assertTrue(repository.register(resource, user));
}
}