-
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.
Merge pull request #32 from Nexters/dev
Dev -> Main 2023.08.13 03.24...
- Loading branch information
Showing
16 changed files
with
142 additions
and
62 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
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
19 changes: 0 additions & 19 deletions
19
.../com/nexters/moyeomoyeo/team_building/controller/dto/response/UserChoiceInfoResponse.java
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
src/main/java/com/nexters/moyeomoyeo/team_building/domain/constant/Constant.java
This file was deleted.
Oops, something went wrong.
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
3 changes: 3 additions & 0 deletions
3
src/main/java/com/nexters/moyeomoyeo/team_building/domain/repository/UserRepository.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,11 +1,14 @@ | ||
package com.nexters.moyeomoyeo.team_building.domain.repository; | ||
|
||
import com.nexters.moyeomoyeo.team_building.domain.entity.User; | ||
|
||
import java.util.Optional; | ||
|
||
public interface UserRepository { | ||
|
||
User save(User user); | ||
|
||
void delete(User user); | ||
|
||
Optional<User> findByUuid(String uuid); | ||
} |
5 changes: 4 additions & 1 deletion
5
src/main/java/com/nexters/moyeomoyeo/team_building/infra/UserJpa.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,10 +1,13 @@ | ||
package com.nexters.moyeomoyeo.team_building.infra; | ||
|
||
import com.nexters.moyeomoyeo.team_building.domain.entity.User; | ||
import java.util.Optional; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import java.util.Optional; | ||
|
||
public interface UserJpa extends JpaRepository<User, Long> { | ||
|
||
Optional<User> findByUuid(String uuid); | ||
|
||
void delete(User user); | ||
} |
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
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
11 changes: 9 additions & 2 deletions
11
src/test/java/com/nexters/moyeomoyeo/MoyeoMoyeoApplicationTests.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,14 +1,21 @@ | ||
package com.nexters.moyeomoyeo; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.core.env.Environment; | ||
|
||
|
||
@SpringBootTest(properties = {"spring.config.location=classpath:application-test.yml"}) | ||
@MoyeoMoyeoTest | ||
class MoyeoMoyeoApplicationTests { | ||
|
||
@Autowired | ||
private Environment environment; | ||
|
||
@Test | ||
void contextLoads() { | ||
assertEquals("test", environment.getActiveProfiles()[0]); | ||
} | ||
|
||
} |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.nexters.moyeomoyeo; | ||
|
||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.test.context.ActiveProfiles; | ||
|
||
@Target(ElementType.TYPE) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Documented | ||
@SpringBootTest(properties = {"spring.config.location=classpath:application-test.yml"}) | ||
@ActiveProfiles("test") | ||
public @interface MoyeoMoyeoTest { | ||
|
||
} |
56 changes: 56 additions & 0 deletions
56
src/test/java/com/nexters/moyeomoyeo/team_building/service/TeamBuildingServiceTest.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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package com.nexters.moyeomoyeo.team_building.service; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import com.nexters.moyeomoyeo.MoyeoMoyeoTest; | ||
import com.nexters.moyeomoyeo.team_building.controller.dto.request.TeamBuildingRequest; | ||
import com.nexters.moyeomoyeo.team_building.controller.dto.request.TeamRequest; | ||
import com.nexters.moyeomoyeo.team_building.controller.dto.response.TeamBuildingResponse; | ||
import com.nexters.moyeomoyeo.team_building.domain.constant.Position; | ||
import com.nexters.moyeomoyeo.team_building.domain.constant.RoundStatus; | ||
import java.util.List; | ||
import org.junit.jupiter.api.Test; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
|
||
@MoyeoMoyeoTest | ||
class TeamBuildingServiceTest { | ||
|
||
@Autowired | ||
private TeamBuildingService teamBuildingService; | ||
|
||
|
||
@Test | ||
void createTeamBuilding() { | ||
final var saveResponse = saveTeamBuildingWithTeams(); | ||
final TeamBuildingResponse findResponse = teamBuildingService.findTeamBuildingAndTeams( | ||
saveResponse.getTeamBuildingInfo().getTeamBuildingUrl()); | ||
|
||
// team building | ||
assertEquals(saveResponse.getTeamBuildingInfo().getTeamBuildingUrl(), | ||
findResponse.getTeamBuildingInfo().getTeamBuildingUrl()); | ||
assertEquals(RoundStatus.FIRST_ROUND, findResponse.getTeamBuildingInfo().getRoundStatus()); | ||
|
||
//team | ||
assertEquals(saveResponse.getTeamInfoList().get(0).getTeamName(), | ||
findResponse.getTeamInfoList().get(0).getTeamName()); | ||
assertEquals(saveResponse.getTeamInfoList().get(1).getTeamName(), | ||
findResponse.getTeamInfoList().get(1).getTeamName()); | ||
} | ||
|
||
private TeamBuildingResponse saveTeamBuildingWithTeams() { | ||
return teamBuildingService.createTeamBuilding(TeamBuildingRequest.builder() | ||
.name("team-Building") | ||
.teams(List.of( | ||
TeamRequest.builder() | ||
.name("team1") | ||
.pmName("pm1") | ||
.pmPosition(Position.FRONT_END) | ||
.build(), | ||
TeamRequest.builder() | ||
.name("team2") | ||
.pmName("pm2") | ||
.pmPosition(Position.BACK_END) | ||
.build())) | ||
.build()); | ||
} | ||
} |
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