From f1b14de3ba7b772588b71e03234aab555f03e131 Mon Sep 17 00:00:00 2001 From: Josh Cummings Date: Mon, 27 Mar 2023 17:01:59 -0600 Subject: [PATCH] Format ObservationConvention Configuration Issue gh-12534 --- .../authentication/ObservationAuthenticationManager.java | 4 ++-- .../ObservationReactiveAuthenticationManager.java | 6 +++--- .../authorization/ObservationAuthorizationManager.java | 4 ++-- .../ObservationReactiveAuthorizationManager.java | 6 +++--- .../ObservationAuthenticationManagerTests.java | 6 +++--- .../ObservationReactiveAuthenticationManagerTests.java | 5 ++--- .../authorization/ObservationAuthorizationManagerTests.java | 6 +++--- .../ObservationReactiveAuthorizationManagerTests.java | 6 +++--- 8 files changed, 21 insertions(+), 22 deletions(-) diff --git a/core/src/main/java/org/springframework/security/authentication/ObservationAuthenticationManager.java b/core/src/main/java/org/springframework/security/authentication/ObservationAuthenticationManager.java index 4994ae3db9..8b15aa845c 100644 --- a/core/src/main/java/org/springframework/security/authentication/ObservationAuthenticationManager.java +++ b/core/src/main/java/org/springframework/security/authentication/ObservationAuthenticationManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -59,7 +59,6 @@ public final class ObservationAuthenticationManager implements AuthenticationMan /** * Use the provided convention for reporting observation data - * * @param convention The provided convention * * @since 6.1 @@ -68,4 +67,5 @@ public final class ObservationAuthenticationManager implements AuthenticationMan Assert.notNull(convention, "The observation convention cannot be null"); this.convention = convention; } + } diff --git a/core/src/main/java/org/springframework/security/authentication/ObservationReactiveAuthenticationManager.java b/core/src/main/java/org/springframework/security/authentication/ObservationReactiveAuthenticationManager.java index bec6635f72..93d7dd9d75 100644 --- a/core/src/main/java/org/springframework/security/authentication/ObservationReactiveAuthenticationManager.java +++ b/core/src/main/java/org/springframework/security/authentication/ObservationReactiveAuthenticationManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,11 +20,11 @@ import io.micrometer.observation.Observation; import io.micrometer.observation.ObservationConvention; import io.micrometer.observation.ObservationRegistry; import io.micrometer.observation.contextpropagation.ObservationThreadLocalAccessor; -import org.springframework.util.Assert; import reactor.core.publisher.Mono; import org.springframework.security.core.Authentication; import org.springframework.security.core.AuthenticationException; +import org.springframework.util.Assert; /** * An {@link ReactiveAuthenticationManager} that observes the authentication @@ -66,7 +66,6 @@ public class ObservationReactiveAuthenticationManager implements ReactiveAuthent /** * Use the provided convention for reporting observation data - * * @param convention The provided convention * * @since 6.1 @@ -75,4 +74,5 @@ public class ObservationReactiveAuthenticationManager implements ReactiveAuthent Assert.notNull(convention, "The observation convention cannot be null"); this.convention = convention; } + } diff --git a/core/src/main/java/org/springframework/security/authorization/ObservationAuthorizationManager.java b/core/src/main/java/org/springframework/security/authorization/ObservationAuthorizationManager.java index 92ae44135c..624d704961 100644 --- a/core/src/main/java/org/springframework/security/authorization/ObservationAuthorizationManager.java +++ b/core/src/main/java/org/springframework/security/authorization/ObservationAuthorizationManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -72,7 +72,6 @@ public final class ObservationAuthorizationManager implements AuthorizationMa /** * Use the provided convention for reporting observation data - * * @param convention The provided convention * * @since 6.1 @@ -81,4 +80,5 @@ public final class ObservationAuthorizationManager implements AuthorizationMa Assert.notNull(convention, "The observation convention cannot be null"); this.convention = convention; } + } diff --git a/core/src/main/java/org/springframework/security/authorization/ObservationReactiveAuthorizationManager.java b/core/src/main/java/org/springframework/security/authorization/ObservationReactiveAuthorizationManager.java index ae7b650412..d7e3d522d7 100644 --- a/core/src/main/java/org/springframework/security/authorization/ObservationReactiveAuthorizationManager.java +++ b/core/src/main/java/org/springframework/security/authorization/ObservationReactiveAuthorizationManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,11 +20,11 @@ import io.micrometer.observation.Observation; import io.micrometer.observation.ObservationConvention; import io.micrometer.observation.ObservationRegistry; import io.micrometer.observation.contextpropagation.ObservationThreadLocalAccessor; -import org.springframework.util.Assert; import reactor.core.publisher.Mono; import org.springframework.security.access.AccessDeniedException; import org.springframework.security.core.Authentication; +import org.springframework.util.Assert; /** * An {@link ReactiveAuthorizationManager} that observes the authentication @@ -71,7 +71,6 @@ public final class ObservationReactiveAuthorizationManager implements Reactiv /** * Use the provided convention for reporting observation data - * * @param convention The provided convention * * @since 6.1 @@ -80,4 +79,5 @@ public final class ObservationReactiveAuthorizationManager implements Reactiv Assert.notNull(convention, "The observation convention cannot be null"); this.convention = convention; } + } diff --git a/core/src/test/java/org/springframework/security/authentication/ObservationAuthenticationManagerTests.java b/core/src/test/java/org/springframework/security/authentication/ObservationAuthenticationManagerTests.java index 46e5fe4b83..6eff320e2e 100644 --- a/core/src/test/java/org/springframework/security/authentication/ObservationAuthenticationManagerTests.java +++ b/core/src/test/java/org/springframework/security/authentication/ObservationAuthenticationManagerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -95,7 +95,7 @@ public class ObservationAuthenticationManagerTests { @Test void conventionSetterThrowsWhenNull() { - assertThatExceptionOfType(IllegalArgumentException.class) - .isThrownBy(() -> this.tested.setConvention(null)); + assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> this.tested.setConvention(null)); } + } diff --git a/core/src/test/java/org/springframework/security/authentication/ObservationReactiveAuthenticationManagerTests.java b/core/src/test/java/org/springframework/security/authentication/ObservationReactiveAuthenticationManagerTests.java index 718ba010de..55032f833c 100644 --- a/core/src/test/java/org/springframework/security/authentication/ObservationReactiveAuthenticationManagerTests.java +++ b/core/src/test/java/org/springframework/security/authentication/ObservationReactiveAuthenticationManagerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -98,8 +98,7 @@ public class ObservationReactiveAuthenticationManagerTests { @Test void conventionSetterThrowsWhenNull() { - assertThatExceptionOfType(IllegalArgumentException.class) - .isThrownBy(() -> this.tested.setConvention(null)); + assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> this.tested.setConvention(null)); } } diff --git a/core/src/test/java/org/springframework/security/authorization/ObservationAuthorizationManagerTests.java b/core/src/test/java/org/springframework/security/authorization/ObservationAuthorizationManagerTests.java index 1f2b68e1d0..e3e492adcd 100644 --- a/core/src/test/java/org/springframework/security/authorization/ObservationAuthorizationManagerTests.java +++ b/core/src/test/java/org/springframework/security/authorization/ObservationAuthorizationManagerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -120,7 +120,7 @@ public class ObservationAuthorizationManagerTests { @Test void conventionSetterThrowsWhenNull() { - assertThatExceptionOfType(IllegalArgumentException.class) - .isThrownBy(() -> this.tested.setConvention(null)); + assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> this.tested.setConvention(null)); } + } diff --git a/core/src/test/java/org/springframework/security/authorization/ObservationReactiveAuthorizationManagerTests.java b/core/src/test/java/org/springframework/security/authorization/ObservationReactiveAuthorizationManagerTests.java index 3148134650..ab2b61f1ec 100644 --- a/core/src/test/java/org/springframework/security/authorization/ObservationReactiveAuthorizationManagerTests.java +++ b/core/src/test/java/org/springframework/security/authorization/ObservationReactiveAuthorizationManagerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -119,7 +119,7 @@ public class ObservationReactiveAuthorizationManagerTests { @Test void conventionSetterThrowsWhenNull() { - assertThatExceptionOfType(IllegalArgumentException.class) - .isThrownBy(() -> this.tested.setConvention(null)); + assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> this.tested.setConvention(null)); } + }