-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
41 additions
and
243 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 9 additions & 65 deletions
74
src/test/java/com/soptie/server/domain/maker/MakerServiceIntegrationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,23 @@ | ||
package com.soptie.server.domain.maker; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.Test; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
import com.soptie.server.persistence.repository.MakerRepository; | ||
import com.soptie.server.persistence.repository.ThemeRepository; | ||
import com.soptie.server.support.IntegrationTest; | ||
|
||
@IntegrationTest | ||
@Transactional | ||
public class MakerServiceIntegrationTest { | ||
|
||
@Autowired | ||
MakerService makerService; | ||
@Test | ||
@DisplayName("[성공] 메이커와 해당하는 테마 정보를 조회한다.") | ||
void getMakersWithTheme() { //TODO: 테스트 | ||
// given | ||
|
||
@Autowired | ||
MakerRepository makerRepository; | ||
// when | ||
|
||
@Autowired | ||
ThemeRepository themeRepository; | ||
/* | ||
@Nested | ||
class Acquire { | ||
// then | ||
} | ||
|
||
Maker maker1; | ||
Maker maker2; | ||
Theme theme1; | ||
Theme theme2; | ||
long makerId1 = 1L; | ||
long makerId2 = 2L; | ||
long themeId1 = 1L; | ||
long themeId2 = 2L; | ||
String name = "maker"; | ||
String job = "job"; | ||
String profileImageUrl = "profileImageUrl"; | ||
String content = "content"; | ||
List<String> tags = List.of("#tag1", "#tag2", "#tag3"); | ||
@BeforeEach | ||
void setUp() { | ||
maker1 = makerRepository.save(MakerFixture.maker() | ||
.id(makerId1) | ||
.name(name) | ||
.job(job) | ||
.profileImageUrl(profileImageUrl) | ||
.content(content) | ||
.themeId(themeId1) | ||
.tags(tags) | ||
.build() | ||
); | ||
maker2 = makerRepository.save(MakerFixture.maker() | ||
.id(makerId2) | ||
.name(name) | ||
.job(job) | ||
.profileImageUrl(profileImageUrl) | ||
.content(content) | ||
.themeId(themeId2) | ||
.tags(tags) | ||
.build() | ||
); | ||
theme1 = themeRepository.save(ThemeFixture.theme().id(themeId1).name("테마 1").build()); | ||
theme2 = themeRepository.save(ThemeFixture.theme().id(themeId2).name("테마 2").build()); | ||
} | ||
@Test | ||
@DisplayName("[성공] 메이커와 해당하는 테마 정보를 조회한다.") | ||
void acquireAll() { | ||
// given, when | ||
MakerListAcquireServiceResponse actual = makerService.acquireAll(); | ||
// then | ||
assertThat(actual.makers()).hasSize(2); | ||
assertThat(actual.makers().stream().filter(maker -> maker.makerId() == makerId1).findAny()).isNotEmpty(); | ||
assertThat(actual.makers().stream().filter(maker -> maker.makerId() == makerId2).findAny()).isNotEmpty(); | ||
} | ||
}*/ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters