File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed
src/test/java/com/somemore/global/util/encoder Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change 11package com .somemore .global .util .encoder ;
22
3- import static org .assertj .core .api .Assertions .assertThat ;
4-
5- import org .junit .jupiter .api .Test ;
63import org .junit .jupiter .api .DisplayName ;
4+ import org .junit .jupiter .api .Test ;
5+
6+ import java .lang .reflect .InvocationTargetException ;
7+
8+ import static org .assertj .core .api .Assertions .assertThat ;
9+ import static org .assertj .core .api .Assertions .assertThatThrownBy ;
710
811class BCryptPasswordEncoderUtilTest {
912
@@ -33,4 +36,18 @@ void testMatches() {
3336 // then
3437 assertThat (BCryptPasswordEncoderUtil .matches (rawPassword , encodedPassword )).isTrue ();
3538 }
39+
40+ @ Test
41+ @ DisplayName ("인스턴스화 할 수 없다." )
42+ void testConstruct () throws Exception {
43+ // given
44+ var constructor = BCryptPasswordEncoderUtil .class .getDeclaredConstructor ();
45+ constructor .setAccessible (true );
46+
47+ // when & then
48+ assertThatThrownBy (constructor ::newInstance )
49+ .isInstanceOf (InvocationTargetException .class )
50+ .extracting (Throwable ::getCause )
51+ .isInstanceOf (UnsupportedOperationException .class );
52+ }
3653}
You can’t perform that action at this time.
0 commit comments