mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-25 13:32:30 +00:00
Polish ObservationConvention Configuration
Change to setObservationConvention so that it reads more clearly when used, for example `authenticationManager.setObservationConvention` is clearer than `authenticationManager.setConvention`. Change unit test names to follow team conventions. Issue gh-12534
This commit is contained in:
parent
f1b14de3ba
commit
607e40d366
@ -63,7 +63,7 @@ public final class ObservationAuthenticationManager implements AuthenticationMan
|
||||
*
|
||||
* @since 6.1
|
||||
*/
|
||||
public void setConvention(ObservationConvention<AuthenticationObservationContext> convention) {
|
||||
public void setObservationConvention(ObservationConvention<AuthenticationObservationContext> convention) {
|
||||
Assert.notNull(convention, "The observation convention cannot be null");
|
||||
this.convention = convention;
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ public class ObservationReactiveAuthenticationManager implements ReactiveAuthent
|
||||
*
|
||||
* @since 6.1
|
||||
*/
|
||||
public void setConvention(ObservationConvention<AuthenticationObservationContext> convention) {
|
||||
public void setObservationConvention(ObservationConvention<AuthenticationObservationContext> convention) {
|
||||
Assert.notNull(convention, "The observation convention cannot be null");
|
||||
this.convention = convention;
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ public final class ObservationAuthorizationManager<T> implements AuthorizationMa
|
||||
*
|
||||
* @since 6.1
|
||||
*/
|
||||
public void setConvention(ObservationConvention<AuthorizationObservationContext<?>> convention) {
|
||||
public void setObservationConvention(ObservationConvention<AuthorizationObservationContext<?>> convention) {
|
||||
Assert.notNull(convention, "The observation convention cannot be null");
|
||||
this.convention = convention;
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ public final class ObservationReactiveAuthorizationManager<T> implements Reactiv
|
||||
*
|
||||
* @since 6.1
|
||||
*/
|
||||
public void setConvention(ObservationConvention<AuthorizationObservationContext<?>> convention) {
|
||||
public void setObservationConvention(ObservationConvention<AuthorizationObservationContext<?>> convention) {
|
||||
Assert.notNull(convention, "The observation convention cannot be null");
|
||||
this.convention = convention;
|
||||
}
|
||||
|
@ -94,8 +94,9 @@ public class ObservationAuthenticationManagerTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void conventionSetterThrowsWhenNull() {
|
||||
assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> this.tested.setConvention(null));
|
||||
void setObservationConventionWhenNullThenException() {
|
||||
assertThatExceptionOfType(IllegalArgumentException.class)
|
||||
.isThrownBy(() -> this.tested.setObservationConvention(null));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -97,8 +97,9 @@ public class ObservationReactiveAuthenticationManagerTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void conventionSetterThrowsWhenNull() {
|
||||
assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> this.tested.setConvention(null));
|
||||
void setObservationConventionWhenNullThenException() {
|
||||
assertThatExceptionOfType(IllegalArgumentException.class)
|
||||
.isThrownBy(() -> this.tested.setObservationConvention(null));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -119,8 +119,9 @@ public class ObservationAuthorizationManagerTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void conventionSetterThrowsWhenNull() {
|
||||
assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> this.tested.setConvention(null));
|
||||
void setObservationConventionWhenNullThenException() {
|
||||
assertThatExceptionOfType(IllegalArgumentException.class)
|
||||
.isThrownBy(() -> this.tested.setObservationConvention(null));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -118,8 +118,9 @@ public class ObservationReactiveAuthorizationManagerTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void conventionSetterThrowsWhenNull() {
|
||||
assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> this.tested.setConvention(null));
|
||||
void setObservationConventionWhenNullThenException() {
|
||||
assertThatExceptionOfType(IllegalArgumentException.class)
|
||||
.isThrownBy(() -> this.tested.setObservationConvention(null));
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user