Skip to content

Commit 1b4af31

Browse files
committed
Replace "shameless coverage code" in SecurityNamespaceHandlerTests
Signed-off-by: seongm1n <[email protected]>
1 parent a5c38bd commit 1b4af31

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

config/src/test/java/org/springframework/security/config/SecurityNamespaceHandlerTests.java

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import org.springframework.test.util.ReflectionTestUtils;
3131
import org.springframework.util.ClassUtils;
3232

33+
import static org.assertj.core.api.Assertions.assertThat;
3334
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
3435
import static org.mockito.ArgumentMatchers.any;
3536
import static org.mockito.ArgumentMatchers.eq;
@@ -63,12 +64,19 @@ public class SecurityNamespaceHandlerTests {
6364

6465
@Test
6566
public void constructionSucceeds() {
66-
new SecurityNamespaceHandler();
67-
// Shameless class coverage stats boosting
68-
new BeanIds() {
69-
};
70-
new Elements() {
71-
};
67+
assertThat(new SecurityNamespaceHandler()).isNotNull();
68+
}
69+
70+
@Test
71+
public void beanIdsConstantsAreNotEmpty() {
72+
assertThat(BeanIds.AUTHENTICATION_MANAGER).isNotEmpty();
73+
assertThat(BeanIds.SPRING_SECURITY_FILTER_CHAIN).isNotEmpty();
74+
}
75+
76+
@Test
77+
public void elementsConstantsAreNotEmpty() {
78+
assertThat(Elements.HTTP).isNotEmpty();
79+
assertThat(Elements.AUTHENTICATION_MANAGER).isNotEmpty();
7280
}
7381

7482
@Test

0 commit comments

Comments
 (0)