Skip to content

Commit 5c63d94

Browse files
committed
SIGA-399 add subjectDistinguishedName for hashcode containers
1 parent 71dbceb commit 5c63d94

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

siga-test/src/test/java/ee/openeid/siga/test/hashcode/ValidateHashcodeContainerT.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,19 @@ void validateHashcodeContainer() throws JSONException, NoSuchAlgorithmException,
3737
assertThat(response.getBody().path("validationConclusion.policy.policyName"), equalTo("POLv4"));
3838
assertThat(response.getBody().path(REPORT_SIGNATURES + "[0].signedBy"), equalTo("JÕEORG,JAAK-KRISTJAN,38001085718"));
3939
assertThat(response.getBody().path(REPORT_SIGNATURES + "[0].info.bestSignatureTime"), equalTo("2019-02-22T11:04:25Z"));
40+
41+
assertThat(response.getBody().path(REPORT_SIGNATURES + "[0].subjectDistinguishedName.commonName"), equalTo("JÕEORG,JAAK-KRISTJAN,38001085718"));
42+
assertThat(response.getBody().path(REPORT_SIGNATURES + "[0].subjectDistinguishedName.serialNumber"), equalTo("PNOEE-38001085718"));
43+
assertThat(response.getBody().path(REPORT_SIGNATURES + "[1].subjectDistinguishedName.commonName"), equalTo("JÕEORG,JAAK-KRISTJAN,38001085718"));
44+
assertThat(response.getBody().path(REPORT_SIGNATURES + "[1].subjectDistinguishedName.serialNumber"), equalTo("PNOEE-38001085718"));
45+
assertThat(response.getBody().path(REPORT_SIGNATURES + "[2].subjectDistinguishedName.commonName"), equalTo("JÕEORG,JAAK-KRISTJAN,38001085718"));
46+
assertThat(response.getBody().path(REPORT_SIGNATURES + "[2].subjectDistinguishedName.serialNumber"), equalTo("PNOEE-38001085718"));
4047
}
4148

4249
@Test
4350
void validateDDOCHashcodeContainer() throws JSONException, NoSuchAlgorithmException, InvalidKeyException, IOException {
4451
Response response = postContainerValidationReport(flow, hashcodeContainerRequestFromFile("hashcodeDdoc.ddoc"));
4552

46-
4753
assertThat(response.statusCode(), equalTo(200));
4854

4955
assertThat(response.getBody().path(REPORT_VALID_SIGNATURES_COUNT), equalTo(1));
@@ -53,6 +59,9 @@ void validateDDOCHashcodeContainer() throws JSONException, NoSuchAlgorithmExcept
5359
assertThat(response.getBody().path(REPORT_SIGNATURE_FORM), equalTo("DIGIDOC_XML_1.3_hashcode"));
5460
assertThat(response.getBody().path(REPORT_SIGNATURES + "[0].signatureFormat"), equalTo("DIGIDOC_XML_1.3"));
5561
assertThat(response.getBody().path(REPORT_SIGNATURES + "[0].info.bestSignatureTime"), equalTo("2012-10-03T07:46:51Z"));
62+
63+
assertThat(response.getBody().path(REPORT_SIGNATURES + "[0].subjectDistinguishedName.commonName"), equalTo("LUKIN,LIISA,47710110274"));
64+
assertThat(response.getBody().path(REPORT_SIGNATURES + "[0].subjectDistinguishedName.serialNumber"), equalTo("47710110274"));
5665
}
5766

5867
@Test
@@ -74,6 +83,9 @@ void uploadHashcodeContainerAndValidateInSession() throws JSONException, NoSuchA
7483
assertThat(validationResponse.getBody().path(REPORT_SIGNATURES_COUNT), equalTo(1));
7584
assertThat(validationResponse.getBody().path(REPORT_SIGNATURES + "[0].signedBy"), equalTo("JÕEORG,JAAK-KRISTJAN,38001085718"));
7685
assertThat(validationResponse.getBody().path(REPORT_SIGNATURES + "[0].info.bestSignatureTime"), equalTo("2019-02-22T11:04:25Z"));
86+
87+
assertThat(validationResponse.getBody().path(REPORT_SIGNATURES + "[0].subjectDistinguishedName.commonName"), equalTo("JÕEORG,JAAK-KRISTJAN,38001085718"));
88+
assertThat(validationResponse.getBody().path(REPORT_SIGNATURES + "[0].subjectDistinguishedName.serialNumber"), equalTo("PNOEE-38001085718"));
7789
}
7890

7991
@Test
@@ -85,6 +97,9 @@ void createHashcodeContainerSignRemotelyAndValidate() throws JSONException, NoSu
8597
Response validationResponse = getValidationReportForContainerInSession(flow);
8698
assertThat(validationResponse.statusCode(), equalTo(200));
8799
assertThat(validationResponse.getBody().path(REPORT_VALID_SIGNATURES_COUNT), equalTo(1));
100+
101+
assertThat(validationResponse.getBody().path(REPORT_SIGNATURES + "[0].subjectDistinguishedName.commonName"), equalTo("JÕEORG,JAAK-KRISTJAN,38001085718"));
102+
assertThat(validationResponse.getBody().path(REPORT_SIGNATURES + "[0].subjectDistinguishedName.serialNumber"), equalTo("PNOEE-38001085718"));
88103
}
89104

90105
@Test
@@ -117,6 +132,9 @@ void validateHashcodeContainerWithZeroFileSizeDataFiles() throws Exception {
117132
assertThat(validationResponse.getBody().path("validationConclusion.signatures[0].warnings.content"), everyItem(not(containsString("data-file-1.txt"))));
118133
assertThat(validationResponse.getBody().path("validationConclusion.signatures[0].warnings.content"), everyItem(not(containsString("data-file-3.txt"))));
119134
assertThat(validationResponse.getBody().path("validationConclusion.signatures[0].warnings.content"), everyItem(not(containsString("data-file-5.txt"))));
135+
136+
assertThat(validationResponse.getBody().path(REPORT_SIGNATURES + "[0].subjectDistinguishedName.commonName"), equalTo("JÕEORG,JAAK-KRISTJAN,38001085718"));
137+
assertThat(validationResponse.getBody().path(REPORT_SIGNATURES + "[0].subjectDistinguishedName.serialNumber"), equalTo("PNOEE-38001085718"));
120138
}
121139

122140
@Test

0 commit comments

Comments
 (0)