Skip to content

Commit

Permalink
fix Javadoc
Browse files Browse the repository at this point in the history
Signed-off-by: Kai Helbig <[email protected]>
  • Loading branch information
ostrya committed Jan 19, 2023
1 parent 72aba3c commit 1a7435b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
java-version: '8'
- name: Build with Gradle
run: ./gradlew build
- name: Check Javadoc generation
run: ./gradlew javadoc
- name: Run integration tests
run: ./gradlew e2e
- name: Publish test report
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

import javax.annotation.Nonnull;

/** Runtime exception which is thrown when starting or stopping the mock fails */
public class MockServerException extends RuntimeException {
public MockServerException(@Nonnull final String message, @Nonnull final Throwable cause) {
MockServerException(@Nonnull final String message, @Nonnull final Throwable cause) {
super(message, cause);
}
}
13 changes: 11 additions & 2 deletions mock/src/main/java/com/tngtech/keycloakmock/api/ServerConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ public Set<String> getDefaultScopes() {
return Collections.unmodifiableSet(defaultScopes);
}

/**
* Builder for {@link ServerConfig}.
*
* <p>Use this to generate a server configuration to your needs.
*/
public static final class Builder {

private int port = DEFAULT_PORT;
Expand Down Expand Up @@ -285,8 +290,10 @@ public Builder withResourceToMapRolesTo(@Nonnull String resource) {
*
* <p>Set of client scopes to be configured. Default scope 'openid' is always added.
*
* @param scopes as set
* @param defaultScopes as set
* @return builder
* @see <a href="https://openid.net/specs/openid-connect-core-1_0.html#ScopeClaims">scope
* claims</a>
*/
@Nonnull
public Builder withDefaultScopes(@Nonnull final Set<String> defaultScopes) {
Expand All @@ -299,8 +306,10 @@ public Builder withDefaultScopes(@Nonnull final Set<String> defaultScopes) {
*
* <p>A client scope to be configured. Default scope 'openid' is always added.
*
* @param scope as string
* @param defaultScope as string
* @return builder
* @see <a href="https://openid.net/specs/openid-connect-core-1_0.html#ScopeClaims">scope
* claims</a>
*/
@Nonnull
public Builder withDefaultScope(@Nonnull final String defaultScope) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ public Builder withScope(@Nonnull final String scope) {
/**
* Add scopes.
*
* <p>The scope for which this token has been requested. Always contains the scopes configured
* <p>The scopes for which this token has been requested. Always contains the scopes configured
* in ServerConfig.
*
* @param scopes the scopes to add
Expand Down Expand Up @@ -735,6 +735,13 @@ public TokenConfig build() {
}
}

/**
* A container for realm or resource roles, to be used in claims {@code realm_access} or {@code
* resource_access}.
*
* @see Builder#withRealmRole(String)
* @see Builder#withResourceRole(String, String)
*/
public static class Access {

@Nonnull private final Set<String> roles = new HashSet<>();
Expand Down

0 comments on commit 1a7435b

Please sign in to comment.