File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
src/test/java/com/somemore/global/util/encoder Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .somemore .global .util .encoder ;
2+
3+ import static org .assertj .core .api .Assertions .assertThat ;
4+
5+ import org .junit .jupiter .api .Test ;
6+ import org .junit .jupiter .api .DisplayName ;
7+
8+ class BCryptPasswordEncoderUtilTest {
9+
10+ @ Test
11+ @ DisplayName ("비밀번호를 성공적으로 인코딩할 수 있다" )
12+ void testEncode () {
13+ // given
14+ String rawPassword = "password123" ;
15+
16+ // when
17+ String encodedPassword = BCryptPasswordEncoderUtil .encode (rawPassword );
18+
19+ // then
20+ assertThat (encodedPassword ).isNotNull ();
21+
22+ }
23+
24+ @ Test
25+ @ DisplayName ("비밀번호를 성공적으로 매칭시킬 수 있다" )
26+ void testMatches () {
27+ // given
28+ String rawPassword = "password123" ;
29+
30+ // when
31+ String encodedPassword = BCryptPasswordEncoderUtil .encode (rawPassword );
32+
33+ // then
34+ assertThat (BCryptPasswordEncoderUtil .matches (rawPassword , encodedPassword )).isTrue ();
35+ }
36+ }
You can’t perform that action at this time.
0 commit comments