use of com.microsoft.azure.sdk.iot.provisioning.service.auth.ProvisioningConnectionString in project azure-iot-sdk-java by Azure.
the class ProvisioningConnectionStringTest method buildProvisioningConnectionString.
ProvisioningConnectionString buildProvisioningConnectionString() {
ProvisioningConnectionString provisioningConnectionString = Deencapsulation.newInstance(ProvisioningConnectionString.class);
Deencapsulation.setField(provisioningConnectionString, "hostName", VALID_HOST_NAME_PROPERTY_NAME);
Deencapsulation.setField(provisioningConnectionString, "sharedAccessKeyName", VALID_SHARED_ACCESS_KEY_NAME_PROPERTY_NAME);
Deencapsulation.setField(provisioningConnectionString, "sharedAccessKey", VALID_SHARED_ACCESS_KEY_PROPERTY_NAME);
Deencapsulation.setField(provisioningConnectionString, "sharedAccessSignature", VALID_SHARED_ACCESS_SIGNATURE_PROPERTY_NAME);
Deencapsulation.setField(provisioningConnectionString, "deviceProvisioningServiceName", VALID_DEVICE_PROVISIONING_SERVICE_NAME);
Deencapsulation.setField(provisioningConnectionString, "authenticationMethod", mockedAuthenticationMethod);
return provisioningConnectionString;
}
use of com.microsoft.azure.sdk.iot.provisioning.service.auth.ProvisioningConnectionString in project azure-iot-sdk-java by Azure.
the class ProvisioningConnectionStringTest method getSharedAccessSignatureSucceeded.
/* Tests_SRS_PROVISIONINGCONNECTIONSTRING_21_007: [The getSharedAccessSignature shall return the stored sharedAccessSignature.] */
@Test
public void getSharedAccessSignatureSucceeded() {
// arrange
ProvisioningConnectionString provisioningConnectionString = buildProvisioningConnectionString();
// act
String result = provisioningConnectionString.getSharedAccessSignature();
// assert
assertEquals(VALID_SHARED_ACCESS_SIGNATURE_PROPERTY_NAME, result);
}
use of com.microsoft.azure.sdk.iot.provisioning.service.auth.ProvisioningConnectionString in project azure-iot-sdk-java by Azure.
the class ProvisioningConnectionStringTest method toStringSucceeded.
/* Tests_SRS_PROVISIONINGCONNECTIONSTRING_21_002: [The toString shall serialize the object to a string using the following format: HostName=HOSTNAME.b.c.d;SharedAccessKeyName=ACCESSKEYNAME;SharedAccessKey=1234567890abcdefghijklmnopqrstvwxyz=;SharedAccessSignature=] */
@Test
public void toStringSucceeded() {
// arrange
ProvisioningConnectionString provisioningConnectionString = buildProvisioningConnectionString();
// act
String result = provisioningConnectionString.toString();
// assert
assertEquals("HostName=" + VALID_HOST_NAME_PROPERTY_NAME + ";SharedAccessKeyName=" + VALID_SHARED_ACCESS_KEY_NAME_PROPERTY_NAME + ";SharedAccessKey=" + VALID_SHARED_ACCESS_KEY_PROPERTY_NAME + ";SharedAccessSignature=" + VALID_SHARED_ACCESS_SIGNATURE_PROPERTY_NAME, result);
}
Aggregations