@@ -31,21 +31,21 @@ class MapFactorToAuthority {
3131
3232 @ Test
3333 @ DisplayName ("should map PASSWORD to FactorGrantedAuthority.PASSWORD_AUTHORITY" )
34- void shouldMapPasswordFactor () {
34+ void shouldMapToPasswordAuthorityWhenPasswordFactorGiven () {
3535 assertThat (MfaConfiguration .mapFactorToAuthority ("PASSWORD" ))
3636 .isEqualTo (FactorGrantedAuthority .PASSWORD_AUTHORITY );
3737 }
3838
3939 @ Test
4040 @ DisplayName ("should map WEBAUTHN to FactorGrantedAuthority.WEBAUTHN_AUTHORITY" )
41- void shouldMapWebauthnFactor () {
41+ void shouldMapToWebauthnAuthorityWhenWebauthnFactorGiven () {
4242 assertThat (MfaConfiguration .mapFactorToAuthority ("WEBAUTHN" ))
4343 .isEqualTo (FactorGrantedAuthority .WEBAUTHN_AUTHORITY );
4444 }
4545
4646 @ Test
4747 @ DisplayName ("should be case-insensitive" )
48- void shouldBeCaseInsensitive () {
48+ void shouldMapCorrectlyWhenFactorNameIsLowercase () {
4949 assertThat (MfaConfiguration .mapFactorToAuthority ("password" ))
5050 .isEqualTo (FactorGrantedAuthority .PASSWORD_AUTHORITY );
5151 assertThat (MfaConfiguration .mapFactorToAuthority ("webauthn" ))
@@ -54,7 +54,7 @@ void shouldBeCaseInsensitive() {
5454
5555 @ Test
5656 @ DisplayName ("should return null for unknown factor" )
57- void shouldReturnNullForUnknownFactor () {
57+ void shouldReturnNullWhenFactorIsUnknown () {
5858 assertThat (MfaConfiguration .mapFactorToAuthority ("UNKNOWN" )).isNull ();
5959 }
6060 }
@@ -65,7 +65,7 @@ class ResolveFactorAuthorities {
6565
6666 @ Test
6767 @ DisplayName ("should resolve configured factors to authority strings" )
68- void shouldResolveConfiguredFactors () {
68+ void shouldResolveAuthoritiesWhenFactorsConfigured () {
6969 mfaConfigProperties .setFactors (List .of ("PASSWORD" , "WEBAUTHN" ));
7070 List <String > authorities = mfaConfiguration .resolveFactorAuthorities ();
7171 assertThat (authorities ).containsExactly (
@@ -75,14 +75,14 @@ void shouldResolveConfiguredFactors() {
7575
7676 @ Test
7777 @ DisplayName ("should return empty list for empty factors" )
78- void shouldReturnEmptyForEmptyFactors () {
78+ void shouldReturnEmptyListWhenNoFactorsConfigured () {
7979 mfaConfigProperties .setFactors (List .of ());
8080 assertThat (mfaConfiguration .resolveFactorAuthorities ()).isEmpty ();
8181 }
8282
8383 @ Test
8484 @ DisplayName ("should skip unknown factors" )
85- void shouldSkipUnknownFactors () {
85+ void shouldSkipUnknownWhenMixedFactorsConfigured () {
8686 mfaConfigProperties .setFactors (List .of ("PASSWORD" , "UNKNOWN" ));
8787 List <String > authorities = mfaConfiguration .resolveFactorAuthorities ();
8888 assertThat (authorities ).containsExactly (FactorGrantedAuthority .PASSWORD_AUTHORITY );
@@ -144,7 +144,7 @@ void shouldNotThrowWhenWebauthnFactorAndWebauthnEnabled() {
144144
145145 @ Test
146146 @ DisplayName ("should not throw for PASSWORD-only configuration" )
147- void shouldNotThrowForPasswordOnly () {
147+ void shouldNotThrowWhenPasswordOnlyConfigured () {
148148 mfaConfigProperties .setEnabled (true );
149149 mfaConfigProperties .setFactors (List .of ("PASSWORD" ));
150150 // Should not throw (but will log a warning)
0 commit comments