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);
}