@@ -566,10 +566,15 @@ void updateOwner() {
566566 @ DisplayName ("관리자가 가입 신청한 사장님 리스트 조회한다." )
567567 void getNewOwnersAdmin () {
568568 Owner unauthenticatedOwner = userFixture .철수_사장님 ();
569- Owner authenticatedOwner = userFixture .준영_사장님 ();
570569
571- Shop shopA = shopFixture .마슬랜 (unauthenticatedOwner );
572- Shop shopB = shopFixture .신전_떡볶이 (authenticatedOwner );
570+ Shop shop = shopFixture .마슬랜 (null );
571+
572+ OwnerShop ownerShop = OwnerShop .builder ()
573+ .ownerId (unauthenticatedOwner .getId ())
574+ .shopId (shop .getId ())
575+ .build ();
576+
577+ ownerShopRedisRepository .save (ownerShop );
573578
574579 User adminUser = userFixture .코인_운영자 ();
575580 String token = userFixture .getToken (adminUser );
@@ -609,72 +614,6 @@ void getNewOwnersAdmin() {
609614 ));
610615 }
611616
612- @ Test
613- @ DisplayName ("관리자가 가입 신청한 사장님 리스트 조회한다 - V2" )
614- void getNewOwnersAdminV2 () {
615-
616- for (int i = 0 ; i < 11 ; i ++) {
617- User user = User .builder ()
618- .password (passwordEncoder .encode ("1234" ))
619- .nickname ("사장님" + i )
620- .name ("테스트용(인증X)" + i )
621- .phoneNumber ("0109776511" + i )
622- .userType (OWNER )
623- .gender (MAN )
624- .email ("testchulsu@gmail.com" + i )
625- .isAuthed (false )
626- .isDeleted (false )
627- .build ();
628-
629- Owner owner = Owner .builder ()
630- .user (user )
631- .companyRegistrationNumber ("118-80-567" + i )
632- .grantShop (true )
633- .grantEvent (true )
634- .attachments (new ArrayList <>())
635- .build ();
636-
637- OwnerAttachment attachment1 = OwnerAttachment .builder ()
638- .url ("https://test.com/사장님_인증사진_1" + i + ".jpg" )
639- .isDeleted (false )
640- .owner (owner )
641- .build ();
642-
643- OwnerAttachment attachment2 = OwnerAttachment .builder ()
644- .url ("https://test.com/사장님_인증사진_2" + i + ".jpg" )
645- .isDeleted (false )
646- .owner (owner )
647- .build ();
648-
649- owner .getAttachments ().add (attachment1 );
650- owner .getAttachments ().add (attachment2 );
651-
652- adminOwnerRepository .save (owner );
653- }
654-
655- User adminUser = userFixture .코인_운영자 ();
656- String token = userFixture .getToken (adminUser );
657-
658- var response = RestAssured
659- .given ()
660- .header ("Authorization" , "Bearer " + token )
661- .when ()
662- .get ("/admin/users/new-owners" )
663- .then ()
664- .statusCode (HttpStatus .OK .value ())
665- .extract ();
666-
667- assertSoftly (
668- softly -> {
669- softly .assertThat (response .body ().jsonPath ().getInt ("total_count" )).isEqualTo (11 );
670- softly .assertThat (response .body ().jsonPath ().getInt ("current_count" )).isEqualTo (10 );
671- softly .assertThat (response .body ().jsonPath ().getInt ("total_page" )).isEqualTo (2 );
672- softly .assertThat (response .body ().jsonPath ().getInt ("current_page" )).isEqualTo (1 );
673- softly .assertThat (response .body ().jsonPath ().getList ("owners" ).size ()).isEqualTo (10 );
674- }
675- );
676- }
677-
678617 @ Test
679618 @ DisplayName ("관리자가 가입 사장님 리스트 조회한다" )
680619 void getOwnersAdmin () {
0 commit comments