Skip to content

Commit

Permalink
Fixed pre-commit checks
Browse files Browse the repository at this point in the history
Signed-off-by: Akvel <mtakvel@gmail.com>

Amended by ostrya <kai.helbig@tngtech.com>
  • Loading branch information
roshevec authored and ostrya committed Oct 6, 2023
1 parent e5ae925 commit b940695
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
@@ -1,7 +1,6 @@
package com.tngtech.keycloakmock.api;

import com.tngtech.keycloakmock.impl.Protocol;

import java.time.Duration;
import java.util.ArrayList;
import java.util.Collections;
Expand Down Expand Up @@ -382,12 +381,11 @@ public Builder withDefaultScope(@Nonnull final String defaultScope) {
}

/**
* Set default access token lifespan ("exp" filed will be set as issuedAt + tokenLifespan)
* By default lifespan 10 hours.
* Set default access token lifespan ("exp" filed will be set as issuedAt + tokenLifespan). + By
* default lifespan 10 hours.
*
* @param tokenLifespan as duration
* @return builder
*
*/
@Nonnull
public Builder withTokenLifespan(@Nonnull final Duration tokenLifespan) {
Expand Down
Expand Up @@ -7,7 +7,6 @@
import com.tngtech.keycloakmock.impl.UrlConfiguration;
import com.tngtech.keycloakmock.impl.session.Session;
import com.tngtech.keycloakmock.impl.session.UserData;

import java.time.Duration;
import java.util.List;
import java.util.Map;
Expand All @@ -32,10 +31,10 @@ public class TokenHelper {

@Inject
TokenHelper(
@Nonnull TokenGenerator tokenGenerator,
@Nonnull @Named("resources") List<String> resourcesToMapRolesTo,
@Nonnull @Named("scopes") Set<String> defaultScopes,
@Nonnull @Named("tokenLifespan") Duration tokenLifespan) {
@Nonnull TokenGenerator tokenGenerator,
@Nonnull @Named("resources") List<String> resourcesToMapRolesTo,
@Nonnull @Named("scopes") Set<String> defaultScopes,
@Nonnull @Named("tokenLifespan") Duration tokenLifespan) {
this.tokenGenerator = tokenGenerator;
this.resourcesToMapRolesTo = resourcesToMapRolesTo;
this.defaultScopes = defaultScopes;
Expand Down
Expand Up @@ -56,7 +56,9 @@ void setup() {

@Test
void token_is_correctly_generated() {
uut = new TokenHelper(tokenGenerator, Collections.emptyList(), Collections.emptySet(), Duration.ofHours(100));
uut =
new TokenHelper(
tokenGenerator, Collections.emptyList(), Collections.emptySet(), Duration.ofHours(100));

uut.getToken(session, urlConfiguration);

Expand All @@ -83,7 +85,9 @@ void token_is_correctly_generated() {

@Test
void resource_roles_are_used_if_configured() {
uut = new TokenHelper(tokenGenerator, CONFIGURED_RESOURCES, Collections.emptySet(), Duration.ofHours(10));
uut =
new TokenHelper(
tokenGenerator, CONFIGURED_RESOURCES, Collections.emptySet(), Duration.ofHours(10));

uut.getToken(session, urlConfiguration);

Expand Down

0 comments on commit b940695

Please sign in to comment.