Search in sources :

Example 11 with DeviceMethodData

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

the class DeviceMethodDataTest method setStatusSets.

/*
    **Tests_SRS_DEVICEMETHODDATA_25_007: [**The method shall set the status.**]**
     */
@Test
public void setStatusSets() {
    // arrange
    DeviceMethodData testData = new DeviceMethodData(0, "testMessage");
    // act
    testData.setStatus(200);
    // assert
    int testStatus = testData.getStatus();
    assertEquals(200, testStatus);
}
Also used : DeviceMethodData(com.microsoft.azure.sdk.iot.device.DeviceTwin.DeviceMethodData) Test(org.junit.Test)

Example 12 with DeviceMethodData

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

the class DeviceMethodDataTest method getResponseMessageGets.

/*
    **Tests_SRS_DEVICEMETHODDATA_25_004: [**This method shall return the response message previously set.**]**
     */
@Test
public void getResponseMessageGets() {
    // arrange
    DeviceMethodData testData = new DeviceMethodData(0, "testMessage");
    // act
    String testResponse = testData.getResponseMessage();
    // assert
    assertEquals(testResponse, "testMessage");
}
Also used : DeviceMethodData(com.microsoft.azure.sdk.iot.device.DeviceTwin.DeviceMethodData) Test(org.junit.Test)

Aggregations

DeviceMethodData (com.microsoft.azure.sdk.iot.device.DeviceTwin.DeviceMethodData)12 Test (org.junit.Test)12 DeviceClient (com.microsoft.azure.sdk.iot.device.DeviceClient)2 Device (com.microsoft.azure.sdk.iot.service.Device)2 RegistryManager (com.microsoft.azure.sdk.iot.service.RegistryManager)2 AzureSasCredential (com.azure.core.credential.AzureSasCredential)1 TokenCredential (com.azure.core.credential.TokenCredential)1 ClientOptions (com.microsoft.azure.sdk.iot.device.ClientOptions)1 DeviceMethodCallback (com.microsoft.azure.sdk.iot.device.DeviceTwin.DeviceMethodCallback)1 Pair (com.microsoft.azure.sdk.iot.device.DeviceTwin.Pair)1 Property (com.microsoft.azure.sdk.iot.device.DeviceTwin.Property)1 TwinPropertyCallBack (com.microsoft.azure.sdk.iot.device.DeviceTwin.TwinPropertyCallBack)1 IotHubClientProtocol (com.microsoft.azure.sdk.iot.device.IotHubClientProtocol)1 IotHubEventCallback (com.microsoft.azure.sdk.iot.device.IotHubEventCallback)1 MultiplexingClient (com.microsoft.azure.sdk.iot.device.MultiplexingClient)1 MultiplexingClientException (com.microsoft.azure.sdk.iot.device.exceptions.MultiplexingClientException)1 IotHubConnectionString (com.microsoft.azure.sdk.iot.service.IotHubConnectionString)1 IotHubConnectionStringBuilder (com.microsoft.azure.sdk.iot.service.IotHubConnectionStringBuilder)1 ProxyOptions (com.microsoft.azure.sdk.iot.service.ProxyOptions)1 RegistryManagerOptions (com.microsoft.azure.sdk.iot.service.RegistryManagerOptions)1