创建商品功能完善

This commit is contained in:
zhh
2018-04-25 17:22:32 +08:00
parent bc3c569616
commit a41633a9b7
19 changed files with 17839 additions and 6 deletions

View File

@@ -0,0 +1,34 @@
package com.macro.mall;
import com.macro.mall.dao.PmsMemberPriceDao;
import com.macro.mall.model.PmsMemberPrice;
import org.junit.Assert;
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 java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
@RunWith(SpringRunner.class)
@SpringBootTest
public class PmsDaoTests {
@Autowired
private PmsMemberPriceDao memberPriceDao;
@Test
public void testInsertBatch(){
List<PmsMemberPrice> list = new ArrayList<>();
for(int i=0;i<5;i++){
PmsMemberPrice memberPrice = new PmsMemberPrice();
memberPrice.setProductId(1L);
memberPrice.setMemberLevelId((long) (i+1));
memberPrice.setMemberPrice(new BigDecimal("22"));
list.add(memberPrice);
}
int count = memberPriceDao.insertList(list);
Assert.assertEquals(5,count);
}
}