test
This commit is contained in:
snoop 2017-06-25 16:01:46 +09:00
parent 815add8ba4
commit 4044face10

View File

@ -0,0 +1,62 @@
package com.loafle.overflow.meta.dao;
import com.loafle.overflow.AppConfig;
import com.loafle.overflow.JdbcConfiguration;
import com.loafle.overflow.meta.model.MetaMemberStatus;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.util.ArrayList;
import java.util.List;
import static org.junit.Assert.*;
/**
* Created by root on 17. 6. 25.
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class})
public class MetaMemberStatusDAOTest {
@Autowired
private MetaMemberStatusDAO metaMemberStatusDAO;
@Test
public void create() {
MetaMemberStatus statusNoAuth = new MetaMemberStatus();
statusNoAuth.setName("NOAUTH");
MetaMemberStatus statusNormal = new MetaMemberStatus();
statusNormal.setName("NORMAL");
MetaMemberStatus statusDiaPause = new MetaMemberStatus();
statusDiaPause.setName("DIAPAUSE");
MetaMemberStatus statusWithDrawal = new MetaMemberStatus();
statusWithDrawal.setName("WITHDRAWAL");
List<MetaMemberStatus> metaMemberStatuses = new ArrayList<>();
metaMemberStatuses.add(statusNoAuth);
metaMemberStatuses.add(statusNormal);
metaMemberStatuses.add(statusDiaPause);
metaMemberStatuses.add(statusWithDrawal);
for(int indexI = 1; indexI <= metaMemberStatuses.size(); ++indexI) {
MetaMemberStatus status = metaMemberStatuses.get(indexI-1);
status.setId((short)indexI);
this.metaMemberStatusDAO.save(status);
}
}
}