|
|
|
@ -101,6 +101,20 @@ public class DeviceManagementProviderServiceTest extends BaseDeviceManagementTes
|
|
|
|
|
Assert.assertTrue(deviceTypes.size() > 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testGetAvailableDeviceType() throws DeviceManagementException {
|
|
|
|
|
DeviceType deviceType = deviceMgtService.getDeviceType(DEVICE_TYPE);
|
|
|
|
|
Assert.assertTrue(deviceType.getName().equalsIgnoreCase(DEVICE_TYPE));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void addLicense() throws DeviceManagementException {
|
|
|
|
|
License license = new License();
|
|
|
|
|
license.setLanguage("ENG");
|
|
|
|
|
license.setName("RANDON_DEVICE_LICENSE");
|
|
|
|
|
deviceMgtService.addLicense(DEVICE_TYPE, license);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test(expectedExceptions = DeviceManagementException.class)
|
|
|
|
|
public void testNullDeviceEnrollment() throws DeviceManagementException {
|
|
|
|
|
deviceMgtService.enrollDevice(null);
|
|
|
|
@ -293,6 +307,12 @@ public class DeviceManagementProviderServiceTest extends BaseDeviceManagementTes
|
|
|
|
|
Assert.assertTrue(device.getDeviceInfo() != null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test(dependsOnMethods = {"testSuccessfulDeviceEnrollment"})
|
|
|
|
|
public void testGetDeviceTypeWithProps() throws DeviceManagementException {
|
|
|
|
|
Device device = deviceMgtService.getDeviceWithTypeProperties(new DeviceIdentifier(DEVICE_ID, DEVICE_TYPE));
|
|
|
|
|
Assert.assertTrue(!device.getProperties().isEmpty());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test(dependsOnMethods = {"testSuccessfulDeviceEnrollment"})
|
|
|
|
|
public void testGetDeviceWithOutInfo() throws DeviceManagementException {
|
|
|
|
|
Device device = deviceMgtService.getDevice(new DeviceIdentifier(DEVICE_ID, DEVICE_TYPE)
|
|
|
|
@ -544,6 +564,26 @@ public class DeviceManagementProviderServiceTest extends BaseDeviceManagementTes
|
|
|
|
|
Assert.assertTrue(result.getRecordsTotal() > 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test(dependsOnMethods = {"testSuccessfulDeviceEnrollment"})
|
|
|
|
|
public void testSetOwnership() throws DeviceManagementException {
|
|
|
|
|
boolean status = deviceMgtService.setOwnership(new DeviceIdentifier(DEVICE_ID,
|
|
|
|
|
DEVICE_TYPE), EnrolmentInfo.OwnerShip.COPE.toString());
|
|
|
|
|
Assert.assertTrue(status);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test(dependsOnMethods = {"testSuccessfulDeviceEnrollment"})
|
|
|
|
|
public void testSetOwnershipNonExistentDT() throws DeviceManagementException {
|
|
|
|
|
boolean status = deviceMgtService.setOwnership(new DeviceIdentifier(DEVICE_ID,
|
|
|
|
|
"non-existent-dt"), EnrolmentInfo.OwnerShip.COPE.toString());
|
|
|
|
|
Assert.assertFalse(status);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test(dependsOnMethods = {"testSuccessfulDeviceEnrollment"}, expectedExceptions =
|
|
|
|
|
DeviceManagementException.class)
|
|
|
|
|
public void testSetOwnershipOfNullDevice() throws DeviceManagementException {
|
|
|
|
|
deviceMgtService.setOwnership(null, EnrolmentInfo.OwnerShip.COPE.toString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test(dependsOnMethods = {"testSuccessfulDeviceEnrollment"})
|
|
|
|
|
public void testGetDeviesByStatus() throws DeviceManagementException {
|
|
|
|
|
PaginationRequest request = new PaginationRequest(0, 100);
|
|
|
|
|