member test code
This commit is contained in:
parent
7058602752
commit
4465399164
|
@ -8,6 +8,7 @@ import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
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.ActiveProfiles;
|
||||||
import org.springframework.test.context.ContextConfiguration;
|
import org.springframework.test.context.ContextConfiguration;
|
||||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||||
|
@ -29,13 +30,14 @@ public class MemberDAOTest {
|
||||||
@Test
|
@Test
|
||||||
public void createMember() {
|
public void createMember() {
|
||||||
Member m = new Member();
|
Member m = new Member();
|
||||||
|
BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
|
||||||
m.setName("insanity2");
|
m.setName("insanity2");
|
||||||
m.setCompanyName("loafle");
|
m.setCompanyName("loafle");
|
||||||
m.setPw("bbbbbbbbb");
|
m.setPw(passwordEncoder.encode("!@#$qwer1234"));
|
||||||
|
// m.setPw("!@#$qwer1234");
|
||||||
m.setPhone("000-000-0000");
|
m.setPhone("000-000-0000");
|
||||||
m.setEmail("insanity1112@loafle.com");
|
m.setEmail("geekhot@hotmail.co.kr");
|
||||||
m.setStatus(new MetaMemberStatus((short)3));
|
m.setStatus(new MetaMemberStatus((short)1));
|
||||||
|
|
||||||
repo.save(m);
|
repo.save(m);
|
||||||
Assert.assertNotEquals(m.getId(), 0);
|
Assert.assertNotEquals(m.getId(), 0);
|
||||||
|
@ -47,7 +49,8 @@ public class MemberDAOTest {
|
||||||
member.setEmail("overflow@loafle.com");
|
member.setEmail("overflow@loafle.com");
|
||||||
|
|
||||||
Member rr = repo.findByEmail("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());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -17,7 +17,7 @@ import java.util.Date;
|
||||||
/**
|
/**
|
||||||
* Created by insanity on 17. 6. 28.
|
* Created by insanity on 17. 6. 28.
|
||||||
*/
|
*/
|
||||||
//@Ignore
|
@Ignore
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
@RunWith(SpringJUnit4ClassRunner.class)
|
||||||
@ActiveProfiles("test")
|
@ActiveProfiles("test")
|
||||||
@ContextConfiguration(classes = {AppConfigTest.class})
|
@ContextConfiguration(classes = {AppConfigTest.class})
|
||||||
|
@ -33,7 +33,7 @@ public class MemberServiceTest {
|
||||||
m.setStatus(new MetaMemberStatus((short)1));
|
m.setStatus(new MetaMemberStatus((short)1));
|
||||||
m.setCreateDate(new Date());
|
m.setCreateDate(new Date());
|
||||||
m.setCompanyName("Loafle");
|
m.setCompanyName("Loafle");
|
||||||
m.setEmail("admin@loafle.com");
|
m.setEmail("geekhot@hotmail.co.kr");
|
||||||
m.setName("administrator");
|
m.setName("administrator");
|
||||||
m.setPhone("00000000");
|
m.setPhone("00000000");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user