Search in sources :

Example 1 with ImportMode

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

the class ExportImportDeviceTest method gettersAndSettersWork.

// Tests_SRS_SERVICE_SDK_JAVA_IMPORT_EXPORT_DEVICE_15_001: [The ExportImportDevice class shall have the following properties: Id, Etag, ImportMode, Status, StatusReason, Authentication]
@Test
public void gettersAndSettersWork() {
    // arrange
    ExportImportDevice device = Deencapsulation.newInstance(ExportImportDevice.class, new Class[] {});
    AuthenticationMechanism expectedAuthentication = new AuthenticationMechanism(AuthenticationType.CERTIFICATE_AUTHORITY);
    String expectedETag = "etag";
    String expectedId = "id";
    ImportMode expectedImportMode = ImportMode.Create;
    DeviceStatus expectedStatus = DeviceStatus.Disabled;
    String expectedStatusReason = "test";
    // act
    device.setAuthentication(expectedAuthentication);
    device.seteTag(expectedETag);
    device.setId(expectedId);
    device.setImportMode(expectedImportMode);
    device.setStatus(expectedStatus);
    device.setStatusReason(expectedStatusReason);
    // assert
    assertEquals(expectedAuthentication, device.getAuthenticationFinal());
    assertEquals(expectedETag, device.geteTag());
    assertEquals(expectedId, device.getId());
    assertEquals(expectedImportMode, device.getImportMode());
    assertEquals(expectedStatus, device.getStatus());
    assertEquals(expectedStatusReason, device.getStatusReason());
}
Also used : ImportMode(com.microsoft.azure.sdk.iot.service.ImportMode) AuthenticationMechanism(com.microsoft.azure.sdk.iot.service.auth.AuthenticationMechanism) ExportImportDevice(com.microsoft.azure.sdk.iot.service.ExportImportDevice) DeviceStatus(com.microsoft.azure.sdk.iot.service.DeviceStatus) Test(org.junit.Test)

Aggregations

DeviceStatus (com.microsoft.azure.sdk.iot.service.DeviceStatus)1 ExportImportDevice (com.microsoft.azure.sdk.iot.service.ExportImportDevice)1 ImportMode (com.microsoft.azure.sdk.iot.service.ImportMode)1 AuthenticationMechanism (com.microsoft.azure.sdk.iot.service.auth.AuthenticationMechanism)1 Test (org.junit.Test)1