Skip to content

Replace "shameless coverage code" in SecurityNamespaceHandlerTests with meaningful tests #17689

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.util.ClassUtils;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
Expand Down Expand Up @@ -63,12 +64,19 @@ public class SecurityNamespaceHandlerTests {

@Test
public void constructionSucceeds() {
new SecurityNamespaceHandler();
// Shameless class coverage stats boosting
new BeanIds() {
};
new Elements() {
};
assertThat(new SecurityNamespaceHandler()).isNotNull();
}

@Test
public void beanIdsConstantsAreNotEmpty() {
assertThat(BeanIds.AUTHENTICATION_MANAGER).isNotEmpty();
assertThat(BeanIds.SPRING_SECURITY_FILTER_CHAIN).isNotEmpty();
}

@Test
public void elementsConstantsAreNotEmpty() {
assertThat(Elements.HTTP).isNotEmpty();
assertThat(Elements.AUTHENTICATION_MANAGER).isNotEmpty();
}

@Test
Expand Down