Skip to content

Commit

Permalink
SIGA-399 add subjectDistinguishedName for asic containers
Browse files Browse the repository at this point in the history
  • Loading branch information
heititobi committed Jun 22, 2023
1 parent 5c63d94 commit 2f8a4d7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ void validateAsicContainer() throws JSONException, NoSuchAlgorithmException, Inv
assertThat(response.getBody().path("validationConclusion.policy.policyName"), equalTo("POLv4"));
assertThat(response.getBody().path(REPORT_SIGNATURES + "[0].signedBy"), equalTo("ŽÕRINÜWŠKY,MÄRÜ-LÖÖZ,11404176865"));
assertThat(response.getBody().path(REPORT_SIGNATURES + "[0].info.bestSignatureTime"), equalTo("2014-11-17T14:11:46Z"));

assertThat(response.getBody().path(REPORT_SIGNATURES + "[0].subjectDistinguishedName.commonName"), equalTo("ŽÕRINÜWŠKY,MÄRÜ-LÖÖZ,11404176865"));
assertThat(response.getBody().path(REPORT_SIGNATURES + "[0].subjectDistinguishedName.serialNumber"), equalTo("11404176865"));
}

@Test
Expand All @@ -61,6 +64,9 @@ void validateDDOCContainer() throws JSONException, NoSuchAlgorithmException, Inv
assertThat(response.statusCode(), equalTo(200));
assertThat(response.getBody().path(REPORT_VALID_SIGNATURES_COUNT), equalTo(1));
assertThat(response.getBody().path(REPORT_SIGNATURES_COUNT), equalTo(1));

assertThat(response.getBody().path(REPORT_SIGNATURES + "[0].subjectDistinguishedName.commonName"), equalTo("ŽÕRINÜWŠKY,MÄRÜ-LÖÖZ,11404176865"));
assertThat(response.getBody().path(REPORT_SIGNATURES + "[0].subjectDistinguishedName.serialNumber"), equalTo("11404176865"));
}

@Test
Expand Down Expand Up @@ -92,6 +98,13 @@ void uploadAsicContainerAndValidateInSession() throws JSONException, NoSuchAlgor
assertThat(validationResponse.getBody().path(REPORT_SIGNATURES_COUNT), equalTo(3));
assertThat(validationResponse.getBody().path(REPORT_SIGNATURES + "[0].signedBy"), equalTo("ŽÕRINÜWŠKY,MÄRÜ-LÖÖZ,11404176865"));
assertThat(validationResponse.getBody().path(REPORT_SIGNATURES + "[0].info.bestSignatureTime"), equalTo("2014-11-17T14:11:46Z"));

assertThat(validationResponse.getBody().path(REPORT_SIGNATURES + "[0].subjectDistinguishedName.commonName"), equalTo("ŽÕRINÜWŠKY,MÄRÜ-LÖÖZ,11404176865"));
assertThat(validationResponse.getBody().path(REPORT_SIGNATURES + "[0].subjectDistinguishedName.serialNumber"), equalTo("11404176865"));
assertThat(validationResponse.getBody().path(REPORT_SIGNATURES + "[1].subjectDistinguishedName.commonName"), equalTo("JÕEORG,JAAK-KRISTJAN,38001085718"));
assertThat(validationResponse.getBody().path(REPORT_SIGNATURES + "[1].subjectDistinguishedName.serialNumber"), equalTo("PNOEE-38001085718"));
assertThat(validationResponse.getBody().path(REPORT_SIGNATURES + "[2].subjectDistinguishedName.commonName"), equalTo("JÕEORG,JAAK-KRISTJAN,38001085718"));
assertThat(validationResponse.getBody().path(REPORT_SIGNATURES + "[2].subjectDistinguishedName.serialNumber"), equalTo("PNOEE-38001085718"));
}

@Test
Expand All @@ -103,6 +116,9 @@ void createAsicContainerSignRemotelyAndValidate() throws JSONException, NoSuchAl
Response validationResponse = getValidationReportForContainerInSession(flow);
assertThat(validationResponse.statusCode(), equalTo(200));
assertThat(validationResponse.getBody().path(REPORT_VALID_SIGNATURES_COUNT), equalTo(1));

assertThat(validationResponse.getBody().path(REPORT_SIGNATURES + "[0].subjectDistinguishedName.commonName"), equalTo("JÕEORG,JAAK-KRISTJAN,38001085718"));
assertThat(validationResponse.getBody().path(REPORT_SIGNATURES + "[0].subjectDistinguishedName.serialNumber"), equalTo("PNOEE-38001085718"));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ void validateDDOCHashcodeContainer() throws JSONException, NoSuchAlgorithmExcept
assertThat(response.getBody().path(REPORT_SIGNATURE_FORM), equalTo("DIGIDOC_XML_1.3_hashcode"));
assertThat(response.getBody().path(REPORT_SIGNATURES + "[0].signatureFormat"), equalTo("DIGIDOC_XML_1.3"));
assertThat(response.getBody().path(REPORT_SIGNATURES + "[0].info.bestSignatureTime"), equalTo("2012-10-03T07:46:51Z"));

assertThat(response.getBody().path(REPORT_SIGNATURES + "[0].subjectDistinguishedName.commonName"), equalTo("LUKIN,LIISA,47710110274"));
assertThat(response.getBody().path(REPORT_SIGNATURES + "[0].subjectDistinguishedName.serialNumber"), equalTo("47710110274"));
}

@Test
Expand Down

0 comments on commit 2f8a4d7

Please sign in to comment.