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());
}
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);
}
Aggregations