Search in sources :

Example 6 with MaterialOrg

use of com.bc.pmpheep.back.po.MaterialOrg in project pmph by BCSquad.

the class MaterialOrgServiceTest method testAddMaterialOrgs.

@Test
@Rollback(Const.ISROLLBACK)
public void testAddMaterialOrgs() {
    MaterialOrg materialOrg1 = new MaterialOrg(1L, 1L);
    MaterialOrg materialOrg2 = new MaterialOrg(1L, 2L);
    MaterialOrg materialOrg3 = new MaterialOrg(2L, 1L);
    MaterialOrg materialOrg4 = new MaterialOrg(2L, 2L);
    List<MaterialOrg> materialOrgs = new ArrayList<>();
    materialOrgs.add(materialOrg2);
    materialOrgs.add(materialOrg3);
    materialOrgs.add(materialOrg4);
    Assert.assertTrue("addMaterialOrg 添加失败", materialOrgService.addMaterialOrg(materialOrg1).getId() > 0);
    Assert.assertTrue("addMaterialOrg 添加失败", materialOrgService.addMaterialOrg(materialOrg3).getId() > 0);
    // 批量新增
    Assert.assertTrue("addMaterialOrgs添加失败", materialOrgService.addMaterialOrgs(materialOrgs) > 0);
}
Also used : ArrayList(java.util.ArrayList) MaterialOrg(com.bc.pmpheep.back.po.MaterialOrg) Test(org.junit.Test) BaseTest(com.bc.pmpheep.test.BaseTest) Rollback(org.springframework.test.annotation.Rollback)

Aggregations

MaterialOrg (com.bc.pmpheep.back.po.MaterialOrg)6 BaseTest (com.bc.pmpheep.test.BaseTest)4 Test (org.junit.Test)4 Rollback (org.springframework.test.annotation.Rollback)4 ArrayList (java.util.ArrayList)2 CmsContent (com.bc.pmpheep.back.po.CmsContent)1 Material (com.bc.pmpheep.back.po.Material)1 Org (com.bc.pmpheep.back.po.Org)1 PmphUser (com.bc.pmpheep.back.po.PmphUser)1 CheckedServiceException (com.bc.pmpheep.service.exception.CheckedServiceException)1 IOException (java.io.IOException)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 LinkedHashMap (java.util.LinkedHashMap)1 LinkedList (java.util.LinkedList)1 Map (java.util.Map)1