File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
src/test/java/com/oronaminc/join/room/service Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 2323import com .oronaminc .join .room .domain .RoomStatus ;
2424import com .oronaminc .join .room .domain .RoomType ;
2525import com .oronaminc .join .room .dto .RoomUpdateStatusRequest ;
26+ import com .oronaminc .join .room .util .CodeGenerator ;
2627
2728@ SpringBootTest
2829@ ActiveProfiles ("test" )
@@ -48,12 +49,21 @@ class RoomCacheTests {
4849
4950 @ BeforeEach
5051 void setUp () {
52+ String code ;
53+ while (true ) {
54+ String codeTest = CodeGenerator .generateCode (6 );
55+ if (!roomReader .existsBySecretCode (codeTest )) {
56+ code = codeTest ;
57+ break ;
58+ }
59+ }
60+
5161 Room room = Room .builder ()
5262 .title ("Test Room" )
5363 .description ("Test Description" )
5464 .roomStatus (RoomStatus .BEFORE_START )
5565 .roomType (RoomType .PUBLIC )
56- .secretCode ("123456" )
66+ .secretCode (code )
5767 .build ();
5868
5969 roomRepository .save (room );
You can’t perform that action at this time.
0 commit comments