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:
Josh Cummings 2023-03-28 12:20:24 -06:00
parent f1b14de3ba
commit 607e40d366
8 changed files with 16 additions and 12 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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));
}
}

View File

@ -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));
}
}

View File

@ -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));
}
}

View File

@ -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));
}
}