test
This commit is contained in:
snoop 2017-06-04 18:51:07 +09:00
parent 0a5c2b94ed
commit 8d57db4bbe
6 changed files with 30 additions and 2 deletions

View File

@ -42,6 +42,11 @@
<version>9.4-1200-jdbc41</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>RELEASE</version>
</dependency>
</dependencies>

View File

@ -21,7 +21,7 @@ public class NoAuthAgent {
@Column(name="DATE", nullable=false)
private Date date;
@Column(name="API_KEY", nullable=false)
@Column(name="API_KEY", unique = true, nullable=false)
private String apiKey;
@Column(name="AUTH_STATUS", nullable=false)

View File

@ -3,6 +3,7 @@ package com.loafle.overflow.apikey.dao;
import com.loafle.overflow.apikey.model.Apikey;
import com.loafle.overflow.member.model.Member;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import java.util.Date;
@ -22,6 +23,7 @@ public class JPAApiKeyDaoTest {
}
@Ignore
@Test
public void findByApiKey() throws Exception {
@ -35,6 +37,7 @@ public class JPAApiKeyDaoTest {
}
@Ignore
@Test
public void createApiKey() {
Apikey apikey = new Apikey();

View File

@ -2,6 +2,7 @@ package com.loafle.overflow.member.dao;
import com.loafle.overflow.member.model.Member;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;
@ -23,6 +24,7 @@ public class JPAMemberDAOTest {
public void findByEmail() throws Exception {
}
@Ignore
@Test
public void createMember() {
Member m = new Member();

View File

@ -1,8 +1,12 @@
package com.loafle.overflow.noauthagent.dao;
import com.loafle.overflow.noauthagent.model.NoAuthAgent;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import java.util.Date;
import static org.junit.Assert.*;
/**
@ -25,4 +29,18 @@ public class JPANoAuthAgentDAOTest {
public void findAllByNoAuth() throws Exception {
}
@Ignore
@Test
public void createNoAuthAgent() {
NoAuthAgent noAuthAgent = new NoAuthAgent();
noAuthAgent.setApiKey("aaaaaaa");
noAuthAgent.setDate(new Date());
noAuthAgent.setHostName("Snoop pc");
noAuthAgent.setLocalIP(4123);
noAuthAgent.setTempKey("3398473-90847903874");
this.jpaNoAuthAgentDAO.create(noAuthAgent);
}
}

View File

@ -13,7 +13,7 @@
<property name="javax.persistence.jdbc.user" value="vertx" />
<property name="javax.persistence.jdbc.password" value="qwe123" />
<!--<property name="hibernate.hbm2ddl.auto" value="create-drop"/>-->
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.hbm2ddl.auto" value="create"/>
<property name="hibernate.show_sql" value="true" />
</properties>
</persistence-unit>