Search in sources :

Example 11 with SymmetricKey

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

the class SymmetricKeyTest method setSecondaryKey_length_greater_than_64.

// Tests_SRS_SERVICE_SDK_JAVA_SYMMETRICKEY_12_003: [The function shall throw IllegalArgumentException if the length of the key less than 16 or greater than 64]
// Assert
@Test(expected = IllegalArgumentException.class)
public void setSecondaryKey_length_greater_than_64() {
    // Arrange
    String key = "01234567890123456789012345678901234567890123456789012345678901234";
    SymmetricKey symmetricKey = new SymmetricKey();
    // Act
    symmetricKey.setSecondaryKey(key);
}
Also used : SymmetricKey(com.microsoft.azure.sdk.iot.service.auth.SymmetricKey) Test(org.junit.Test)

Aggregations

SymmetricKey (com.microsoft.azure.sdk.iot.service.auth.SymmetricKey)11 Test (org.junit.Test)10 Device (com.microsoft.azure.sdk.iot.service.Device)2 DeviceStatus (com.microsoft.azure.sdk.iot.service.DeviceStatus)1 NonStrictExpectations (mockit.NonStrictExpectations)1