Skip to content

Commit

Permalink
[FEAT] Group Service Test
Browse files Browse the repository at this point in the history
  • Loading branch information
jinjoo-lab committed Nov 26, 2023
1 parent 9d0f0b0 commit 42263ee
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package com.twtw.backend.domain.group.service;

import com.twtw.backend.domain.group.dto.request.JoinGroupRequest;
import com.twtw.backend.domain.group.dto.request.MakeGroupRequest;
import com.twtw.backend.domain.group.dto.response.GroupInfoResponse;
import com.twtw.backend.domain.group.dto.response.SimpleGroupInfoResponse;
import com.twtw.backend.domain.group.entity.Group;
import com.twtw.backend.domain.group.entity.GroupMember;
import com.twtw.backend.domain.group.repository.GroupMemberRepository;
import com.twtw.backend.domain.group.repository.GroupRepository;
import com.twtw.backend.domain.member.entity.Member;
import com.twtw.backend.domain.member.repository.MemberRepository;
import com.twtw.backend.fixture.group.GroupEntityFixture;
import com.twtw.backend.fixture.member.MemberEntityFixture;
import com.twtw.backend.support.service.LoginTest;
import jakarta.persistence.EntityManager;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;

import static org.assertj.core.api.Assertions.assertThat;

@DisplayName("GroupService의")
public class GroupServiceTest extends LoginTest {
@Autowired private GroupService groupService;

@Autowired private GroupRepository groupRepository;

@Autowired private MemberRepository memberRepository;

@Autowired private GroupMemberRepository groupMemberRepository;

@Autowired private EntityManager em;

@Test
@DisplayName("makeGroup이 성공적으로 수행되는가")
void makeGroup(){
// given
MakeGroupRequest request = new MakeGroupRequest("JINJOOONEKING","JIN_GROUP_IMAGE");

// when
GroupInfoResponse response = groupService.makeGroup(request);

// then
assertThat(response.getName()).isEqualTo("JINJOOONEKING");
}

@Test
@DisplayName("Group에 Join할 수 있는가")
void joinGroup(){

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class MemberServiceTest extends LoginTest {
@Autowired private MemberService memberService;
@Autowired private MemberRepository memberRepository;


@Test
@DisplayName("닉네임 중복 체크가 제대로 동작하는가")
void checkNickname() {
Expand Down

0 comments on commit 42263ee

Please sign in to comment.