This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
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
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
src/test/java/io/codechobo/review/interfaces/api/ReviewRestControllerIntegrationTest.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,43 @@ | ||
package io.codechobo.review.interfaces.api; | ||
|
||
import io.codechobo.review.domain.Review; | ||
import io.codechobo.review.domain.repository.ReviewRepository; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; | ||
import org.springframework.test.context.ActiveProfiles; | ||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | ||
|
||
import static org.hamcrest.core.Is.is; | ||
import static org.junit.Assert.assertThat; | ||
|
||
@RunWith(SpringJUnit4ClassRunner.class) | ||
@DataJpaTest | ||
@ActiveProfiles(value = "test") | ||
public class ReviewRestControllerIntegrationTest { | ||
|
||
@Autowired | ||
private ReviewRepository reviewRepository; | ||
|
||
private Review review; | ||
|
||
@Before | ||
public void setUp() { | ||
|
||
} | ||
|
||
@Test | ||
public void 리뷰_정보_등록() { | ||
//given | ||
Review review = new Review(new Integer(0),new Integer(0),"영화가 재밌음", 1L,"memberId"); | ||
|
||
//when | ||
Review saveReview = reviewRepository.save(review); | ||
|
||
//then | ||
assertThat(saveReview.getReviewContent(), is("영화가 재밌음")); | ||
|
||
} | ||
} |