When performing unit tests, set the test cell to a transaction rollback to avoid generating dirty data!!!!!
Import Org.junit.Test;
Import Org.junit.runner.RunWith;
Import Org.slf4j.Logger;
Import Org.slf4j.LoggerFactory;
Import org.springframework.beans.factory.annotation.Autowired;
Import org.springframework.test.context.ContextConfiguration;
Import Org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
Import org.springframework.test.context.transaction.TransactionConfiguration;
Import org.springframework.transaction.annotation.Transactional;
Import Com.bookingctrip.api.manual.service.WalletBatchService; /** * @author YZP * @version 1.0 * @parameter * @return/@SuppressWarnings ("deprecation") @TransactionConfiguration (TransactionManager = "TransactionManager", Defaultrollback = True) @Transactional @RunWith (
Springjunit4classrunner.class) @ContextConfiguration (locations = "Classpath*:context/applicationcontext.xml")
public class Testwalletbatch {static final Logger log = Loggerfactory.getlogger (Testwalletbatch.class); @Autowired private Walletbatchservice Batchservice;
@Test public void Testselectprimarykeybybatchno () {String Batchno = "pay2017010901ffn6q2x0setpmv0x";
Long Selectprimarykeybybatchno = Batchservice.selectprimarykeybybatchno (Batchno);
System.out.print (Selectprimarykeybybatchno); }
}