use of com.microsoft.azure.sdk.iot.provisioning.device.internal.parser.RegistrationOperationStatusParser in project azure-iot-sdk-java by Azure.
the class RegistrationOperationStatusParserTest method constructorWithX509JsonThrowsOnNullSha1ThumbprintSigningCert.
// SRS_RegistrationOperationStatusParser_25_017: [ This method shall throw IllegalArgumentException if Sha1 Thumbprint from X509 Signing Certificate Info cannot be parsed. ]
@Test(expected = IllegalArgumentException.class)
public void constructorWithX509JsonThrowsOnNullSha1ThumbprintSigningCert() throws IllegalArgumentException, JsonParseException {
final String json = "{\"operationId\":\"" + TEST_OPERATION_ID + "\"," + "\"status\":\"assigned\"," + "\"registrationState\":" + "{\"x509\":" + "{\"certificateInfo\":" + "{\"subjectName\":\"" + TEST_SUBJECT_NAME + "\"," + "\"sha1Thumbprint\":\"" + TEST_SHA1_THUMBPRINT + "\"," + "\"sha256Thumbprint\":\"" + TEST_SHA256_THUMBPRINT + "\"," + "\"issuerName\":\"" + TEST_ISSUER_NAME + "\"," + "\"notBeforeUtc\":\"2017-01-01T00:00:00Z\"," + "\"notAfterUtc\":\"2037-01-01T00:00:00Z\"," + "\"serialNumber\":\"" + TEST_SERIAL_NUMBER + "\"," + "\"version\":" + TEST_VERSION + "}," + "\"enrollmentGroupId\":\"" + TEST_ENROLLMENT_GROUP_ID + "\"," + "\"signingCertificateInfo\":" + "{\"subjectName\":\"" + TEST_SUBJECT_NAME + "\"," + "\"sha256Thumbprint\":\"" + TEST_SHA256_THUMBPRINT + "\"," + "\"issuerName\":\"" + TEST_ISSUER_NAME + "\"," + "\"notBeforeUtc\":\"2017-01-01T00:00:00Z\"," + "\"notAfterUtc\":\"2037-01-01T00:00:00Z\"," + "\"serialNumber\":\"" + TEST_SERIAL_NUMBER + "\"," + "\"version\":" + TEST_VERSION + "}" + "}," + "\"registrationId\":\"" + TEST_REGISTRATION_ID + "\"," + "\"createdDateTimeUtc\":\"2017-07-21T20:56:19.3109747Z\"," + "\"assignedHub\":\"" + TEST_ASSIGNED_HUB + "\"," + "\"deviceId\":\"" + TEST_DEVICE_ID + "\"," + "\"status\":\"assigned\"," + "\"etag\":\"172d963d-ec26-41ba-84c4-afe5f6c93ef4\"," + "\"lastUpdatedDateTimeUtc\":\"2017-07-21T20:56:19.7978138Z\"}}\n";
RegistrationOperationStatusParser operationsRegistrationOperationStatusParser = RegistrationOperationStatusParser.createFromJson(json);
}
Aggregations