게시글
고민있어요
너무 어렵군요..
- 0
- 1
- 156
질문&답변
이 강의를 들으며 잘 진행을 해왔는데...
앗.. 감사합니다..
- 0
- 5
- 314
질문&답변
이 강의를 들으며 잘 진행을 해왔는데...
spring: datasource: url: jdbc:h2:tcp://localhost/~/jpashop username: sa password: driver-class-name: org.h2.Driverjpa: hibernate: ddl-auto: create properties: hibernate:# show_sql: true format_sql: truelogging.level: org.hibernate.SQL: debug org.hibernate.type: trace 이렇게 입니다!
- 0
- 5
- 314
질문&답변
이 강의를 들으며 잘 진행을 해왔는데...
package jpabook.jpashop.service;import jpabook.jpashop.domain.Member;import jpabook.jpashop.repository.MemberRepository;import org.junit.Test;import org.junit.runner.RunWith;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.boot.test.context.SpringBootTest;import org.springframework.test.annotation.Rollback;import org.springframework.test.context.junit4.SpringRunner;import org.springframework.transaction.annotation.Transactional;import javax.persistence.EntityManager;import static org.junit.Assert.*;@RunWith(SpringRunner.class)@SpringBootTest@Transactionalpublic class MemberServiceTest { @Autowired MemberService memberService; @Autowired MemberRepository memberRepository; @Autowired EntityManager em; @Test @Rollback(false) public void 회원가입() throws Exception{ // given Member member = new Member(); member.setName("kim"); // when Long saveId = memberService.join(member); // then em.flush(); assertEquals(member, memberRepository.findOne(saveId)); } @Test public void 중복_회원_예외() throws Exception{ // given // when // then }} 현재 코드입니다.
- 0
- 5
- 314