member test code

This commit is contained in:
geek 2017-09-05 14:38:28 +09:00
parent 7058602752
commit 4465399164
2 changed files with 10 additions and 7 deletions

View File

@ -8,6 +8,7 @@ import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@ -29,13 +30,14 @@ public class MemberDAOTest {
@Test
public void createMember() {
Member m = new Member();
BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
m.setName("insanity2");
m.setCompanyName("loafle");
m.setPw("bbbbbbbbb");
m.setPw(passwordEncoder.encode("!@#$qwer1234"));
// m.setPw("!@#$qwer1234");
m.setPhone("000-000-0000");
m.setEmail("insanity1112@loafle.com");
m.setStatus(new MetaMemberStatus((short)3));
m.setEmail("geekhot@hotmail.co.kr");
m.setStatus(new MetaMemberStatus((short)1));
repo.save(m);
Assert.assertNotEquals(m.getId(), 0);
@ -47,7 +49,8 @@ public class MemberDAOTest {
member.setEmail("overflow@loafle.com");
Member rr = repo.findByEmail("overflow@loafle.com");
System.out.println("rr.getCompanyName() = " + rr.getCompanyName());
Assert.assertNotNull(rr);
// System.out.println("rr.getCompanyName() = " + rr.getCompanyName());
}
}

View File

@ -17,7 +17,7 @@ import java.util.Date;
/**
* Created by insanity on 17. 6. 28.
*/
//@Ignore
@Ignore
@RunWith(SpringJUnit4ClassRunner.class)
@ActiveProfiles("test")
@ContextConfiguration(classes = {AppConfigTest.class})
@ -33,7 +33,7 @@ public class MemberServiceTest {
m.setStatus(new MetaMemberStatus((short)1));
m.setCreateDate(new Date());
m.setCompanyName("Loafle");
m.setEmail("admin@loafle.com");
m.setEmail("geekhot@hotmail.co.kr");
m.setName("administrator");
m.setPhone("00000000");