junit测试代码模板,后面只贴出其中不一样的地方
import com.wn.dao.CustomerRepository;
import com.wn.dao.LinkmanRepository;
import com.wn.domain.Customer;
import com.wn.domain.Linkman;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.Rollback;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:applicationContext.xml")
public class JpaManyTest {
@Autowired
private CustomerRepository customerRepository;
@Autowired
private LinkmanRepository linkmanRepository