Skip to content

Commit 8970352

Browse files
committed
Format ObservationConvention Configuration
Issue gh-12534
1 parent eb11863 commit 8970352

8 files changed

+21
-22
lines changed

core/src/main/java/org/springframework/security/authentication/ObservationAuthenticationManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -59,7 +59,6 @@ public Authentication authenticate(Authentication authentication) throws Authent
5959

6060
/**
6161
* Use the provided convention for reporting observation data
62-
*
6362
* @param convention The provided convention
6463
*
6564
* @since 6.1
@@ -68,4 +67,5 @@ public void setConvention(ObservationConvention<AuthenticationObservationContext
6867
Assert.notNull(convention, "The observation convention cannot be null");
6968
this.convention = convention;
7069
}
70+
7171
}

core/src/main/java/org/springframework/security/authentication/ObservationReactiveAuthenticationManager.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,11 +20,11 @@
2020
import io.micrometer.observation.ObservationConvention;
2121
import io.micrometer.observation.ObservationRegistry;
2222
import io.micrometer.observation.contextpropagation.ObservationThreadLocalAccessor;
23-
import org.springframework.util.Assert;
2423
import reactor.core.publisher.Mono;
2524

2625
import org.springframework.security.core.Authentication;
2726
import org.springframework.security.core.AuthenticationException;
27+
import org.springframework.util.Assert;
2828

2929
/**
3030
* An {@link ReactiveAuthenticationManager} that observes the authentication
@@ -66,7 +66,6 @@ public Mono<Authentication> authenticate(Authentication authentication) throws A
6666

6767
/**
6868
* Use the provided convention for reporting observation data
69-
*
7069
* @param convention The provided convention
7170
*
7271
* @since 6.1
@@ -75,4 +74,5 @@ public void setConvention(ObservationConvention<AuthenticationObservationContext
7574
Assert.notNull(convention, "The observation convention cannot be null");
7675
this.convention = convention;
7776
}
77+
7878
}

core/src/main/java/org/springframework/security/authorization/ObservationAuthorizationManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -72,7 +72,6 @@ public AuthorizationDecision check(Supplier<Authentication> authentication, T ob
7272

7373
/**
7474
* Use the provided convention for reporting observation data
75-
*
7675
* @param convention The provided convention
7776
*
7877
* @since 6.1
@@ -81,4 +80,5 @@ public void setConvention(ObservationConvention<AuthorizationObservationContext<
8180
Assert.notNull(convention, "The observation convention cannot be null");
8281
this.convention = convention;
8382
}
83+
8484
}

core/src/main/java/org/springframework/security/authorization/ObservationReactiveAuthorizationManager.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,11 +20,11 @@
2020
import io.micrometer.observation.ObservationConvention;
2121
import io.micrometer.observation.ObservationRegistry;
2222
import io.micrometer.observation.contextpropagation.ObservationThreadLocalAccessor;
23-
import org.springframework.util.Assert;
2423
import reactor.core.publisher.Mono;
2524

2625
import org.springframework.security.access.AccessDeniedException;
2726
import org.springframework.security.core.Authentication;
27+
import org.springframework.util.Assert;
2828

2929
/**
3030
* An {@link ReactiveAuthorizationManager} that observes the authentication
@@ -71,7 +71,6 @@ public Mono<AuthorizationDecision> check(Mono<Authentication> authentication, T
7171

7272
/**
7373
* Use the provided convention for reporting observation data
74-
*
7574
* @param convention The provided convention
7675
*
7776
* @since 6.1
@@ -80,4 +79,5 @@ public void setConvention(ObservationConvention<AuthorizationObservationContext<
8079
Assert.notNull(convention, "The observation convention cannot be null");
8180
this.convention = convention;
8281
}
82+
8383
}

core/src/test/java/org/springframework/security/authentication/ObservationAuthenticationManagerTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -95,7 +95,7 @@ void authenticationWhenErrorsThenObserves() {
9595

9696
@Test
9797
void conventionSetterThrowsWhenNull() {
98-
assertThatExceptionOfType(IllegalArgumentException.class)
99-
.isThrownBy(() -> this.tested.setConvention(null));
98+
assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> this.tested.setConvention(null));
10099
}
100+
101101
}

core/src/test/java/org/springframework/security/authentication/ObservationReactiveAuthenticationManagerTests.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -98,8 +98,7 @@ void authenticationWhenErrorsThenObserves() {
9898

9999
@Test
100100
void conventionSetterThrowsWhenNull() {
101-
assertThatExceptionOfType(IllegalArgumentException.class)
102-
.isThrownBy(() -> this.tested.setConvention(null));
101+
assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> this.tested.setConvention(null));
103102
}
104103

105104
}

core/src/test/java/org/springframework/security/authorization/ObservationAuthorizationManagerTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -120,7 +120,7 @@ void verifyWhenLooksUpAuthenticationThenObserves() {
120120

121121
@Test
122122
void conventionSetterThrowsWhenNull() {
123-
assertThatExceptionOfType(IllegalArgumentException.class)
124-
.isThrownBy(() -> this.tested.setConvention(null));
123+
assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> this.tested.setConvention(null));
125124
}
125+
126126
}

core/src/test/java/org/springframework/security/authorization/ObservationReactiveAuthorizationManagerTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -119,7 +119,7 @@ void verifyWhenLooksUpAuthenticationThenObserves() {
119119

120120
@Test
121121
void conventionSetterThrowsWhenNull() {
122-
assertThatExceptionOfType(IllegalArgumentException.class)
123-
.isThrownBy(() -> this.tested.setConvention(null));
122+
assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> this.tested.setConvention(null));
124123
}
124+
125125
}

0 commit comments

Comments
 (0)