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