コード例 #1
0
  @Test
  public void testValidateDocumentMetaData_SupportedMimeType() {
    System.out.println("testValidateDocumentMetaData_SupportedMimeType");
    ProvideAndRegisterDocumentSetRequestType body = new XDRMessageHelper().getSampleMessage();

    XDRHelper instance = createHelper(true);

    RegistryErrorList result = instance.validateDocumentMetaData(body);
    assertNotNull(result);
  }
コード例 #2
0
  @Ignore
  public void testValidateDocumentMetaData_ValidMessage() {
    System.out.println("testValidateDocumentMetaData_ValidMessage");
    ProvideAndRegisterDocumentSetRequestType body = new XDRMessageHelper().getSampleMessage();
    XDRHelper instance = createHelper();

    RegistryErrorList result = instance.validateDocumentMetaData(body);
    assertNotNull(result);
    assertEquals(0, result.getRegistryError().size());
    assertEquals("", result.getHighestSeverity());
  }
コード例 #3
0
  @Test
  public void testValidateDocumentMetaData_UnsupportedMimeType() {
    System.out.println("testValidateDocumentMetaData_UnsupportedMimeType");
    ProvideAndRegisterDocumentSetRequestType body = new XDRMessageHelper().getSampleMessage();

    XDRHelper instance = createHelper(false);

    RegistryErrorList result = instance.validateDocumentMetaData(body);
    assertNotNull(result);
    assertEquals(1, result.getRegistryError().size());
    assertEquals(XDRHelper.XDS_ERROR_SEVERITY_ERROR, result.getHighestSeverity());
    assertEquals(
        XDRHelper.XDS_ERROR_SEVERITY_ERROR, result.getRegistryError().get(0).getSeverity());
    assertNotNull(result.getRegistryError().get(0).getCodeContext());
  }
コード例 #4
0
  @Test
  public void testValidateDocumentMetaData_Null() {
    System.out.println("testValidateDocumentMetaData_Null");
    ProvideAndRegisterDocumentSetRequestType body = null;
    XDRHelper instance = createHelper();

    RegistryErrorList result = instance.validateDocumentMetaData(body);
    assertNotNull(result);
    assertEquals(1, result.getRegistryError().size());
    assertEquals(XDRHelper.XDS_ERROR_SEVERITY_ERROR, result.getHighestSeverity());
    assertEquals(
        XDRHelper.XDS_ERROR_SEVERITY_ERROR, result.getRegistryError().get(0).getSeverity());
    assertEquals(
        XDRHelper.XDR_EC_XDSMissingDocument, result.getRegistryError().get(0).getErrorCode());
    assertNotNull(result.getRegistryError().get(0).getCodeContext());
  }
コード例 #5
0
  @Test
  public void testValidateDocumentMetaData_PatIdsNoMatch() {
    System.out.println("testValidateDocumentMetaData_PatIdsNoMatch");
    ProvideAndRegisterDocumentSetRequestType body =
        new XDRMessageHelper().getSampleMessage("ProvideAndRegisterDocumentSet-MultiPat.xml");

    XDRHelper instance = createHelper(true);

    RegistryErrorList result = instance.validateDocumentMetaData(body);
    assertNotNull(result);
    assertEquals(1, result.getRegistryError().size());
    assertEquals(XDRHelper.XDS_ERROR_SEVERITY_ERROR, result.getHighestSeverity());
    assertEquals(
        XDRHelper.XDS_ERROR_SEVERITY_ERROR, result.getRegistryError().get(0).getSeverity());
    assertEquals(
        XDRHelper.XDR_EC_XDSPatientIdDoesNotMatch, result.getRegistryError().get(0).getErrorCode());
    assertNotNull(result.getRegistryError().get(0).getCodeContext());
  }
コード例 #6
0
  @Test
  public void testValidateDocumentMetaData_MissingDoc() {
    System.out.println("testValidateDocumentMetaData_ValidMessage");
    ProvideAndRegisterDocumentSetRequestType body = new XDRMessageHelper().getSampleMessage();

    body.getDocument().clear();
    XDRHelper instance = createHelper();

    RegistryErrorList result = instance.validateDocumentMetaData(body);
    assertNotNull(result);
    assertEquals(1, result.getRegistryError().size());
    assertEquals(NhincConstants.XDS_REGISTRY_ERROR_SEVERITY_ERROR, result.getHighestSeverity());
    assertEquals(
        NhincConstants.XDS_REGISTRY_ERROR_SEVERITY_ERROR,
        result.getRegistryError().get(0).getSeverity());
    assertEquals(
        XDRHelper.XDR_EC_XDSMissingDocument, result.getRegistryError().get(0).getErrorCode());
    assertNotNull(result.getRegistryError().get(0).getCodeContext());
  }