Search in sources :

Example 1 with DeviceStatus

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

the class DeviceTest method constructor_sets_status_and_symmetrickey.

// Tests_SRS_SERVICE_SDK_JAVA_DEVICE_15_007: [The constructor shall store
// the input device status and symmetric key into a member variable]
@Test
public void constructor_sets_status_and_symmetrickey() throws NoSuchAlgorithmException {
    // Arrange
    String deviceId = "xxx-device";
    DeviceStatus expectedDeviceStatus = DeviceStatus.Disabled;
    SymmetricKey expectedSymmetricKey = new SymmetricKey();
    // Act
    Device device = Deencapsulation.newInstance(Device.class, deviceId, expectedDeviceStatus, expectedSymmetricKey);
    // Assert
    assertEquals(expectedDeviceStatus, device.getStatus());
    assertEquals(expectedSymmetricKey, device.getSymmetricKey());
}
Also used : Device(com.microsoft.azure.sdk.iot.service.Device) SymmetricKey(com.microsoft.azure.sdk.iot.service.auth.SymmetricKey) DeviceStatus(com.microsoft.azure.sdk.iot.service.DeviceStatus) Test(org.junit.Test)

Aggregations

Device (com.microsoft.azure.sdk.iot.service.Device)1 DeviceStatus (com.microsoft.azure.sdk.iot.service.DeviceStatus)1 SymmetricKey (com.microsoft.azure.sdk.iot.service.auth.SymmetricKey)1 Test (org.junit.Test)1