trials, but not yet finished

This commit is contained in:
Jottyfan
2022-12-06 22:10:08 +01:00
parent 64f130733f
commit f37e4498e8
6 changed files with 38 additions and 53 deletions

View File

@ -6,24 +6,26 @@
<attribute name="gradle_used_by_scope" value="main,test"/> <attribute name="gradle_used_by_scope" value="main,test"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="src" path="src/test/java"/> <classpathentry kind="src" output="bin/test" path="src/test/java">
<attributes>
<attribute name="gradle_scope" value="test"/>
<attribute name="gradle_used_by_scope" value="test"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/main" path="src/main/resources"> <classpathentry kind="src" output="bin/main" path="src/main/resources">
<attributes> <attributes>
<attribute name="gradle_scope" value="main"/> <attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope" value="main,test"/> <attribute name="gradle_used_by_scope" value="main,test"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17/"> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17/"/>
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/> <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"> <classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer">
<attributes> <attributes>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5"/> <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="output" path="bin/default"/> <classpathentry kind="output" path="bin/default"/>
</classpath> </classpath>

View File

@ -1,13 +1,2 @@
arguments=
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir= connection.project.dir=
eclipse.preferences.version=1 eclipse.preferences.version=1
gradle.user.home=
java.home=
jvm.arguments=
offline.mode=false
override.workspace.settings=false
show.console.view=false
show.executions.view=false

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0"> <?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="camporganizer2"> <wb-module deploy-name="CampOrganizer2">
<property name="context-root" value="camporganizer2"/> <property name="context-root" value="CampOrganizer2"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="src/main/resources"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="src/main/resources"/>

View File

@ -17,7 +17,6 @@ import org.keycloak.representations.idm.UserRepresentation;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
/** /**
* *
* @author henkej * @author henkej
@ -81,19 +80,12 @@ public class KeycloakRepository {
} }
public Client getClient() { public Client getClient() {
return new ResteasyClientBuilderImpl() return new ResteasyClientBuilderImpl().connectionPoolSize(10).build();
.connectionPoolSize(10)
.build();
} }
public KeycloakBuilder getKeycloak() { public KeycloakBuilder getKeycloak() {
return KeycloakBuilder.builder() return KeycloakBuilder.builder().serverUrl(keycloakUrl).realm(keycloakRealm).grantType(OAuth2Constants.PASSWORD)
.serverUrl(keycloakUrl) .username(keycloakAdminName).password(keycloakAdminPassword).clientId(keycloakClientId)
.realm(keycloakRealm)
.grantType(OAuth2Constants.PASSWORD)
.username(keycloakAdminName)
.password(keycloakAdminPassword)
.clientId(keycloakClientId)
.resteasyClient(getClient()); .resteasyClient(getClient());
} }

View File

@ -36,7 +36,7 @@ public class RegistrationService {
public Boolean register(RegistrationBean bean) { public Boolean register(RegistrationBean bean) {
Boolean result = gateway.register(bean); Boolean result = gateway.register(bean);
if (result && bean.getRegisterInKeycloak()) { if (result && bean.getRegisterInKeycloak()) {
keycloak.register(bean.getLogin(), bean.getPassword()); keycloak.register(bean.getLogin(), bean.getPassword(), bean.getEmail());
} }
return result; return result;
} }

View File

@ -5,6 +5,8 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
/** /**
* *