-
Notifications
You must be signed in to change notification settings - Fork 2
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 #16 from a-romantic-cat/feat/14
Feat/14
- Loading branch information
Showing
3 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
src/main/java/aromanticcat/umcproject/repository/MemberRepository.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,7 @@ | ||
package aromanticcat.umcproject.repository; | ||
|
||
import aromanticcat.umcproject.entity.Member; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface MemberRepository extends JpaRepository<Member, Long> { | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/aromanticcat/umcproject/repository/NangmanLetterRepository.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,7 @@ | ||
package aromanticcat.umcproject.repository; | ||
|
||
import aromanticcat.umcproject.entity.NangmanLetter; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface NangmanLetterRepository extends JpaRepository<NangmanLetter, Long> { | ||
} |
39 changes: 39 additions & 0 deletions
39
src/test/java/aromanticcat/umcproject/repository/NangmanLetterTests.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,39 @@ | ||
package aromanticcat.umcproject.repository; | ||
|
||
import aromanticcat.umcproject.entity.Member; | ||
import aromanticcat.umcproject.entity.NangmanLetter; | ||
import org.junit.jupiter.api.Test; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
|
||
@SpringBootTest | ||
public class NangmanLetterTests { | ||
|
||
@Autowired | ||
private NangmanLetterRepository nangmanLetterRepository; | ||
|
||
@Autowired | ||
private MemberRepository memberRepository; | ||
|
||
|
||
@Test | ||
public void testInsertNangmanLetter(){ | ||
|
||
Member member1 = Member.builder() | ||
.email("[email protected]") | ||
.nickname("member1") | ||
.coin(0) | ||
.build(); | ||
memberRepository.save(member1); | ||
|
||
NangmanLetter nangmanLetter = NangmanLetter.builder() | ||
.is_public(false) | ||
.sender_nickname("낭만적인 고양이") | ||
.content("제 고민을 들어주세요") | ||
.member(member1) | ||
.build(); | ||
NangmanLetter result = nangmanLetterRepository.save(nangmanLetter); | ||
|
||
System.out.println(result); | ||
} | ||
} |