Search in sources :

Example 11 with Device

use of com.microsoft.azure.sdk.iot.device.DeviceTwin.Device in project azure-iot-sdk-java by Azure.

the class DeviceTest method setDesiredPropertyCallbackCanAddNullPair.

/*
    **Tests_SRS_DEVICE_25_008: [**This method shall add the parameters to the map even if callback and object pair are null**]**
     */
@Test
public void setDesiredPropertyCallbackCanAddNullPair() {
    //arrange
    Device testDev = new Device() {

        @Override
        public void PropertyCall(String propertyKey, Object propertyValue, Object context) {
        }
    };
    Property test = new Property("DesiredProp1", null);
    //act
    testDev.setDesiredPropertyCallback(test, null, null);
    //assert
    HashMap<Property, Pair<PropertyCallBack<String, Object>, Object>> testDesiredMap = testDev.getDesiredProp();
    assertNotNull(testDesiredMap);
    assertEquals(testDesiredMap.get(test).getKey(), null);
}
Also used : Device(com.microsoft.azure.sdk.iot.device.DeviceTwin.Device) Property(com.microsoft.azure.sdk.iot.device.DeviceTwin.Property) Pair(com.microsoft.azure.sdk.iot.device.DeviceTwin.Pair) Test(org.junit.Test)

Aggregations

Device (com.microsoft.azure.sdk.iot.device.DeviceTwin.Device)11 Test (org.junit.Test)11 Property (com.microsoft.azure.sdk.iot.device.DeviceTwin.Property)9 Pair (com.microsoft.azure.sdk.iot.device.DeviceTwin.Pair)5 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1