Search in sources :

Example 11 with MaterialNoteAttachment

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

the class MaterialNoteAttachmentServiceTest method testGetMaterialNoteAttachmentByMaterialExtraId.

@Test
@Rollback(Const.ISROLLBACK)
public void testGetMaterialNoteAttachmentByMaterialExtraId() {
    MaterialNoteAttachment materialNoteAttachment = new MaterialNoteAttachment();
    materialNoteAttachment.setMaterialExtraId(2L);
    materialNoteAttachment.setAttachment("--");
    materialNoteAttachment.setAttachmentName("---");
    materialNoteAttachment.setDownload(1L);
    materialNoteAttachment.setAttachmentName("++++++");
    materialNoteAttachmentService.addMaterialNoteAttachment(materialNoteAttachment);
    // 根据MaterialExtraId获取
    List<MaterialNoteAttachment> materialNoteAttachments = materialNoteAttachmentService.getMaterialNoteAttachmentByMaterialExtraId(materialNoteAttachment.getMaterialExtraId());
    Assert.assertTrue("获取失败", materialNoteAttachments != null);
    materialNoteAttachmentService.getMaterialNoteAttachmentByMaterialExtraId(r.nextLong());
}
Also used : MaterialNoteAttachment(com.bc.pmpheep.back.po.MaterialNoteAttachment) Test(org.junit.Test) BaseTest(com.bc.pmpheep.test.BaseTest) Rollback(org.springframework.test.annotation.Rollback)

Example 12 with MaterialNoteAttachment

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

the class MaterialNoteAttachmentServiceTest method testUpdateMaterialNoteAttachment.

@Test
@Rollback(Const.ISROLLBACK)
public void testUpdateMaterialNoteAttachment() {
    MaterialNoteAttachment materialNoteAttachment = new MaterialNoteAttachment();
    materialNoteAttachment.setMaterialExtraId(2L);
    materialNoteAttachment.setAttachment("--");
    materialNoteAttachment.setAttachmentName("---");
    materialNoteAttachment.setDownload(1L);
    materialNoteAttachment.setAttachmentName("++++++");
    materialNoteAttachmentService.addMaterialNoteAttachment(materialNoteAttachment);
    // 更新
    Integer res = materialNoteAttachmentService.updateMaterialNoteAttachment(materialNoteAttachment);
    Assert.assertTrue("更新失败", res > 0);
    materialNoteAttachment.setId(r.nextLong());
    Assert.assertTrue("更新失败", materialNoteAttachmentService.updateMaterialNoteAttachment(materialNoteAttachment) >= 0);
}
Also used : MaterialNoteAttachment(com.bc.pmpheep.back.po.MaterialNoteAttachment) Test(org.junit.Test) BaseTest(com.bc.pmpheep.test.BaseTest) Rollback(org.springframework.test.annotation.Rollback)

Aggregations

MaterialNoteAttachment (com.bc.pmpheep.back.po.MaterialNoteAttachment)12 CheckedServiceException (com.bc.pmpheep.service.exception.CheckedServiceException)6 MaterialExtra (com.bc.pmpheep.back.po.MaterialExtra)5 MaterialNoticeAttachment (com.bc.pmpheep.back.po.MaterialNoticeAttachment)5 BaseTest (com.bc.pmpheep.test.BaseTest)5 Test (org.junit.Test)5 Rollback (org.springframework.test.annotation.Rollback)5 CmsContent (com.bc.pmpheep.back.po.CmsContent)4 Material (com.bc.pmpheep.back.po.Material)4 MaterialContact (com.bc.pmpheep.back.po.MaterialContact)3 Content (com.bc.pmpheep.general.po.Content)3 ArrayList (java.util.ArrayList)3 HashMap (java.util.HashMap)3 CmsExtra (com.bc.pmpheep.back.po.CmsExtra)2 MaterialExtension (com.bc.pmpheep.back.po.MaterialExtension)2 PmphUser (com.bc.pmpheep.back.po.PmphUser)2 MaterialProjectEditorVO (com.bc.pmpheep.back.vo.MaterialProjectEditorVO)2 Gson (com.google.gson.Gson)2 MaterialProjectEditor (com.bc.pmpheep.back.po.MaterialProjectEditor)1 MaterialType (com.bc.pmpheep.back.po.MaterialType)1