Skip to content

Commit

Permalink
Update dependency pmd to v7 (#282)
Browse files Browse the repository at this point in the history
* Update dependency pmd to v7

* Fix PMD problems

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael1142 <[email protected]>
  • Loading branch information
renovate[bot] and Michael1142 committed Aug 13, 2024
1 parent 63e053a commit e8cc39f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ checkstyle {
}

pmd {
toolVersion = "6.55.0"
toolVersion = "7.4.0"
ignoreFailures = false
sourceSets = [sourceSets.main, sourceSets.test, sourceSets.integrationTest]
reportsDir = file("$project.buildDir/reports/pmd")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void should_not_request_new_token_if_cached_token_is_still_valid() throws
.willReturn(jwtTokenWithExpDate(now().plus(2, HOURS)));

// when
repeat(5, () -> jwtAuthTokenGenerator.generate());
repeat(5, jwtAuthTokenGenerator::generate);

// then
verify(generator, times(1)).generate();
Expand All @@ -70,7 +70,7 @@ public void should_request_new_token_once_it_expires() throws Exception {
.willReturn(jwtTokenWithExpDate(now().minus(2, HOURS)));

// when
repeat(3, () -> jwtAuthTokenGenerator.generate());
repeat(3, jwtAuthTokenGenerator::generate);

// then
verify(generator, times(3)).generate();
Expand All @@ -83,7 +83,7 @@ public void should_throw_an_exception_if_s2s_token_is_not_a_jwt_token() {
.willReturn("clearly not a valid JWT token");

// when
Throwable exc = catchThrowable(() -> jwtAuthTokenGenerator.generate());
Throwable exc = catchThrowable(jwtAuthTokenGenerator::generate);

// then
assertThat(exc)
Expand Down Expand Up @@ -112,7 +112,7 @@ public void should_request_a_new_token_if_delta_is_larger_than_time_left_to_expi
verify(generator, times(2)).generate();
}

private String jwtTokenWithExpDate(Instant expAtDate) throws Exception {
private String jwtTokenWithExpDate(Instant expAtDate) {
return JWT
.create()
.withExpiresAt(Date.from(expAtDate))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ public void shouldGenerateServiceAuthToken() {
final String result = serviceAuthTokenGenerator.generate();

//then
assertThat(result).isNotNull().isEqualTo(serviceAuthToken);
assertThat(result).isEqualTo(serviceAuthToken);
}
}

0 comments on commit e8cc39f

Please sign in to comment.