use of com.microsoft.azure.sdk.iot.provisioning.service.configs.TpmAttestation in project azure-iot-sdk-java by Azure.
the class TpmAttestationTest method emptyConstructorSucceed.
/* SRS_TPM_ATTESTATION_21_010: [The TpmAttestation shall provide an empty constructor to make GSON happy.] */
@Test
public void emptyConstructorSucceed() {
// arrange
// act
TpmAttestation tpmAttestation = Deencapsulation.newInstance(TpmAttestation.class);
// assert
assertNotNull(tpmAttestation);
}
use of com.microsoft.azure.sdk.iot.provisioning.service.configs.TpmAttestation in project azure-iot-sdk-java by Azure.
the class TpmAttestationTest method gettersSucceed.
/* SRS_TPM_ATTESTATION_21_008: [The getEndorsementKey shall return the store endorsementKey.] */
/* SRS_TPM_ATTESTATION_21_009: [The getStorageRootKey shall return the store storageRootKey.] */
@Test
public void gettersSucceed() {
// arrange
// act
TpmAttestation tpmAttestation = new TpmAttestation(VALID_ENDORSEMENT_KEY, VALID_STORAGE_ROOT_KEY);
// assert
assertEquals(VALID_ENDORSEMENT_KEY, tpmAttestation.getEndorsementKey());
assertEquals(VALID_STORAGE_ROOT_KEY, tpmAttestation.getStorageRootKey());
}
use of com.microsoft.azure.sdk.iot.provisioning.service.configs.TpmAttestation in project azure-iot-sdk-java by Azure.
the class TpmAttestationTest method constructorStoresEndorsementKey.
/* SRS_TPM_ATTESTATION_21_002: [The constructor shall store the provided endorsementKey.] */
/* SRS_TPM_ATTESTATION_21_003: [The constructor shall store the provided storageRootKey.] */
@Test
public void constructorStoresEndorsementKey() {
// arrange
// act
TpmAttestation tpmAttestation = new TpmAttestation(VALID_ENDORSEMENT_KEY, VALID_STORAGE_ROOT_KEY);
// assert
assertEquals(VALID_ENDORSEMENT_KEY, Deencapsulation.getField(tpmAttestation, "endorsementKey"));
assertEquals(VALID_STORAGE_ROOT_KEY, Deencapsulation.getField(tpmAttestation, "storageRootKey"));
}
use of com.microsoft.azure.sdk.iot.provisioning.service.configs.TpmAttestation in project azure-iot-sdk-java by Azure.
the class TpmAttestationTest method constructorOnlyEndorsementKeyStoresEndorsementKey.
/* SRS_TPM_ATTESTATION_21_005: [The constructor shall store the provided endorsementKey.] */
@Test
public void constructorOnlyEndorsementKeyStoresEndorsementKey() {
// arrange
// act
TpmAttestation tpmAttestation = new TpmAttestation(VALID_ENDORSEMENT_KEY);
// assert
assertEquals(VALID_ENDORSEMENT_KEY, Deencapsulation.getField(tpmAttestation, "endorsementKey"));
}
use of com.microsoft.azure.sdk.iot.provisioning.service.configs.TpmAttestation in project azure-iot-sdk-java by Azure.
the class TpmAttestationTest method constructorCopyStoresKeys.
/* SRS_TPM_ATTESTATION_21_007: [The constructor shall store the endorsementKey and storageRootKey provided in the tpm.] */
@Test
public void constructorCopyStoresKeys() {
// arrange
TpmAttestation tpmAttestation = new TpmAttestation(VALID_ENDORSEMENT_KEY, VALID_STORAGE_ROOT_KEY);
// act
TpmAttestation tpmAttestationCopy = new TpmAttestation(tpmAttestation);
// assert
assertEquals(VALID_ENDORSEMENT_KEY, Deencapsulation.getField(tpmAttestationCopy, "endorsementKey"));
assertEquals(VALID_STORAGE_ROOT_KEY, Deencapsulation.getField(tpmAttestationCopy, "storageRootKey"));
}
Aggregations