コード例 #1
0
  @Test
  public void testDeleteQualificationFileById() {
    qualificationFileService.deleteQualificationFileById(1);
    QualificationFile qualificationFile = qualificationFileService.getQualificationFileById(1);

    assertNull(qualificationFile);
  }
コード例 #2
0
  @Test
  public void testUpdateQualificationFile() {
    QualificationFile qualificationFile = qualificationFileService.getQualificationFileById(1);
    qualificationFile.setName("税务登记证");

    qualificationFile = qualificationFileService.updateQualificationFile(qualificationFile, user);
    assertEquals("税务登记证", qualificationFile.getName());
    assertEquals(user.getName(), qualificationFile.getModifiedBy());
    assertNotNull(qualificationFile.getModifyOn());
  }
コード例 #3
0
  @Test
  public void testGetQualificationFileById() {
    QualificationFile qualificationFile = qualificationFileService.getQualificationFileById(1);

    assertEquals("企业法人营业执照", qualificationFile.getName());
    assertEquals("admin", qualificationFile.getCreatedBy());
    assertEquals("2013-06-29 13:58:38", DateTimeUtils.format(qualificationFile.getCreateOn()));
    assertNull(qualificationFile.getModifiedBy());
    assertNull(qualificationFile.getModifyOn());
  }
コード例 #4
0
  @Test
  public void testFindAll() {
    Iterator<QualificationFile> qualificationFiles = qualificationFileService.findAll();
    int total = 0;
    while (qualificationFiles.hasNext()) {
      total++;
      qualificationFiles.next();
    }

    assertEquals(2, total);
  }
コード例 #5
0
  @Test
  public void testCreateNewQualificationFile() {
    QualificationFileCategory qualificationFileCategory =
        qualificationFileCategoryService.getQualificationFileCategoryById(1);
    QualificationFile qualificationFile = new QualificationFile();
    qualificationFile.setName("企业法人营业执照");
    qualificationFile.setFilePath("qualificationFile/qyfzyyzz.jepg");
    qualificationFile.setQualificationFileCategory(qualificationFileCategory);

    qualificationFileService.createNewQualificationFile(qualificationFile, user);
    assertNotNull(qualificationFile.getId());
    assertEquals(user.getName(), qualificationFile.getCreatedBy());
    assertNotNull(qualificationFile.getCreateOn());
    assertEquals(
        qualificationFileCategory.getName(),
        qualificationFile.getQualificationFileCategory().getName());
  }