Skip to content

Commit

Permalink
Merge branch '3.2.x' into 3.3.x
Browse files Browse the repository at this point in the history
Closes gh-42279
  • Loading branch information
mhalbritter committed Sep 12, 2024
2 parents 94fc6b4 + 206c287 commit 4e33605
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
* @author Phillip Webb
* @author Artsiom Yudovin
* @author MyeongHyeon Lee
* @author Moritz Halbritter
* @since 2.0.0
*/
@ConfigurationProperties(prefix = "spring.security.oauth2.client")
Expand Down Expand Up @@ -60,12 +61,12 @@ public void afterPropertiesSet() {
}

public void validate() {
getRegistration().values().forEach(this::validateRegistration);
getRegistration().forEach(this::validateRegistration);
}

private void validateRegistration(Registration registration) {
private void validateRegistration(String id, Registration registration) {
if (!StringUtils.hasText(registration.getClientId())) {
throw new IllegalStateException("Client id must not be empty.");
throw new IllegalStateException("Client id of registration '%s' must not be empty.".formatted(id));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void clientIdAbsentThrowsException() {
registration.setProvider("google");
this.properties.getRegistration().put("foo", registration);
assertThatIllegalStateException().isThrownBy(this.properties::validate)
.withMessageContaining("Client id must not be empty.");
.withMessageContaining("Client id of registration 'foo' must not be empty.");
}

@Test
Expand Down

0 comments on commit 4e33605

Please sign in to comment.