Search in sources :

Example 1 with AuthenticationMethod

use of com.microsoft.azure.sdk.iot.service.AuthenticationMethod in project azure-iot-sdk-java by Azure.

the class IotHubConnectionStringBuilderTest method createConnectionString_hosName_empty.

// Tests_SRS_SERVICE_SDK_JAVA_IOTHUBCONNECTIONSTRINGBUILDER_12_003: [The function shall throw IllegalArgumentException if the input string is empty or null]
// Assert
@Test(expected = IllegalArgumentException.class)
public void createConnectionString_hosName_empty() throws Exception {
    // Arrange
    AuthenticationMethod authenticationMethod = new ServiceAuthenticationWithSharedAccessPolicyKey("", "");
    // Act
    IotHubConnectionString iotHubConnectionString = IotHubConnectionStringBuilder.createConnectionString("", authenticationMethod);
}
Also used : ServiceAuthenticationWithSharedAccessPolicyKey(com.microsoft.azure.sdk.iot.service.ServiceAuthenticationWithSharedAccessPolicyKey) IotHubConnectionString(com.microsoft.azure.sdk.iot.service.IotHubConnectionString) AuthenticationMethod(com.microsoft.azure.sdk.iot.service.AuthenticationMethod) Test(org.junit.Test)

Example 2 with AuthenticationMethod

use of com.microsoft.azure.sdk.iot.service.AuthenticationMethod in project azure-iot-sdk-java by Azure.

the class IotHubConnectionStringBuilderTest method createConnectionString_hostName_null.

// Tests_SRS_SERVICE_SDK_JAVA_IOTHUBCONNECTIONSTRINGBUILDER_12_003: [The function shall throw IllegalArgumentException if the input string is empty or null]
// Assert
@Test(expected = IllegalArgumentException.class)
public void createConnectionString_hostName_null() throws Exception {
    // Arrange
    AuthenticationMethod authenticationMethod = new ServiceAuthenticationWithSharedAccessPolicyKey("", "");
    // Act
    IotHubConnectionString iotHubConnectionString = IotHubConnectionStringBuilder.createConnectionString(null, authenticationMethod);
}
Also used : ServiceAuthenticationWithSharedAccessPolicyKey(com.microsoft.azure.sdk.iot.service.ServiceAuthenticationWithSharedAccessPolicyKey) IotHubConnectionString(com.microsoft.azure.sdk.iot.service.IotHubConnectionString) AuthenticationMethod(com.microsoft.azure.sdk.iot.service.AuthenticationMethod) Test(org.junit.Test)

Example 3 with AuthenticationMethod

use of com.microsoft.azure.sdk.iot.service.AuthenticationMethod in project azure-iot-sdk-java by Azure.

the class IotHubConnectionStringBuilderTest method createConnectionString_authenticationMethod_null.

// Tests_SRS_SERVICE_SDK_JAVA_IOTHUBCONNECTIONSTRINGBUILDER_12_004: [The function shall throw IllegalArgumentException if the input authenticationMethod is null]
// Assert
@Test(expected = IllegalArgumentException.class)
public void createConnectionString_authenticationMethod_null() throws Exception {
    // Arrange
    AuthenticationMethod authenticationMethod = null;
    // Act
    IotHubConnectionString iotHubConnectionString = IotHubConnectionStringBuilder.createConnectionString("test", authenticationMethod);
}
Also used : IotHubConnectionString(com.microsoft.azure.sdk.iot.service.IotHubConnectionString) AuthenticationMethod(com.microsoft.azure.sdk.iot.service.AuthenticationMethod) Test(org.junit.Test)

Aggregations

AuthenticationMethod (com.microsoft.azure.sdk.iot.service.AuthenticationMethod)3 IotHubConnectionString (com.microsoft.azure.sdk.iot.service.IotHubConnectionString)3 Test (org.junit.Test)3 ServiceAuthenticationWithSharedAccessPolicyKey (com.microsoft.azure.sdk.iot.service.ServiceAuthenticationWithSharedAccessPolicyKey)2