package com.consum.test; import java.util.ArrayList; import org.apache.commons.compress.utils.Lists; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import com.consum.base.service.LWhFormInventoryGoodsService; import com.consum.model.po.LWhFormInventoryGoods; @RunWith(SpringRunner.class) @SpringBootTest public class CodeGeneratorServiceTest { @Autowired private LWhFormInventoryGoodsService service; @Test public void createWarehouseCode() { ArrayList objects = Lists.newArrayList(); for (int i = 1; i < 4; i++) { LWhFormInventoryGoods entity = new LWhFormInventoryGoods(); entity.setId(Long.valueOf(i)); entity.setPrice(10.00); objects.add(entity); } int i = service.updateBatch(objects); System.out.println(i); } }