use of com.microsoft.azure.sdk.iot.provisioning.service.auth.ProvisioningConnectionString in project azure-iot-sdk-java by Azure.
the class ProvisioningConnectionStringTest method getSharedAccessKeyNameSucceeded.
/* Tests_SRS_PROVISIONINGCONNECTIONSTRING_21_005: [The getSharedAccessKeyName shall return the stored sharedAccessKeyName.] */
@Test
public void getSharedAccessKeyNameSucceeded() {
// arrange
ProvisioningConnectionString provisioningConnectionString = buildProvisioningConnectionString();
// act
String result = provisioningConnectionString.getSharedAccessKeyName();
// assert
assertEquals(VALID_SHARED_ACCESS_KEY_NAME_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 getUserStringSucceeded.
/* Tests_SRS_PROVISIONINGCONNECTIONSTRING_21_001: [The getUserString shall serialize the object properties to a string using the following format: SharedAccessKeyName@SAS.root.deviceProvisioningServiceName] */
@Test
public void getUserStringSucceeded() {
// arrange
ProvisioningConnectionString provisioningConnectionString = buildProvisioningConnectionString();
// act
String result = provisioningConnectionString.getUserString();
// assert
assertEquals(VALID_SHARED_ACCESS_KEY_NAME_PROPERTY_NAME + "@SAS.root." + VALID_DEVICE_PROVISIONING_SERVICE_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 getHostNameSucceeded.
/* Tests_SRS_PROVISIONINGCONNECTIONSTRING_21_008: [The getHostName shall return the stored hostName.] */
@Test
public void getHostNameSucceeded() {
// arrange
ProvisioningConnectionString provisioningConnectionString = buildProvisioningConnectionString();
// act
String result = provisioningConnectionString.getHostName();
// assert
assertEquals(VALID_HOST_NAME_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 setSharedAccessKeyNameSucceeded.
/* Tests_SRS_PROVISIONINGCONNECTIONSTRING_21_009: [The setSharedAccessKeyName shall update the sharedAccessKeyName by the provided one.] */
@Test
public void setSharedAccessKeyNameSucceeded() {
// arrange
ProvisioningConnectionString provisioningConnectionString = buildProvisioningConnectionString();
final String newValue = "newSharedAccessKeyName";
// act
Deencapsulation.invoke(provisioningConnectionString, "setSharedAccessKeyName", newValue);
// assert
assertEquals(newValue, provisioningConnectionString.getSharedAccessKeyName());
}
use of com.microsoft.azure.sdk.iot.provisioning.service.auth.ProvisioningConnectionString in project azure-iot-sdk-java by Azure.
the class ProvisioningConnectionStringTest method getDeviceProvisioningServiceNameSucceeded.
/* Tests_SRS_PROVISIONINGCONNECTIONSTRING_21_003: [The getDeviceProvisioningServiceName shall return the stored deviceProvisioningServiceName.] */
@Test
public void getDeviceProvisioningServiceNameSucceeded() {
// arrange
ProvisioningConnectionString provisioningConnectionString = buildProvisioningConnectionString();
// act
String result = provisioningConnectionString.getDeviceProvisioningServiceName();
// assert
assertEquals(VALID_DEVICE_PROVISIONING_SERVICE_NAME, result);
}
Aggregations