|
|
|
@ -481,7 +481,8 @@ public class DeviceManagementServiceImplTest {
|
|
|
|
|
public void testDeleteDevice() {
|
|
|
|
|
PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getDeviceManagementService"))
|
|
|
|
|
.toReturn(this.deviceManagementProviderService);
|
|
|
|
|
Response response = this.deviceManagementService.deleteDevice(TEST_DEVICE_TYPE, UUID.randomUUID().toString());
|
|
|
|
|
Response response = this.deviceManagementService.deleteDevice(TEST_DEVICE_TYPE, UUID.randomUUID().toString()
|
|
|
|
|
, false);
|
|
|
|
|
Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -491,7 +492,8 @@ public class DeviceManagementServiceImplTest {
|
|
|
|
|
.toReturn(this.deviceManagementProviderService);
|
|
|
|
|
Mockito.when(this.deviceManagementProviderService
|
|
|
|
|
.getDevice(Mockito.any(DeviceIdentifier.class), Mockito.anyBoolean())).thenReturn(null);
|
|
|
|
|
Response response = this.deviceManagementService.deleteDevice(TEST_DEVICE_TYPE, UUID.randomUUID().toString());
|
|
|
|
|
Response response = this.deviceManagementService.deleteDevice(TEST_DEVICE_TYPE, UUID.randomUUID().toString()
|
|
|
|
|
, false);
|
|
|
|
|
Assert.assertEquals(response.getStatus(), Response.Status.NOT_FOUND.getStatusCode());
|
|
|
|
|
Mockito.reset(this.deviceManagementProviderService);
|
|
|
|
|
}
|
|
|
|
@ -502,7 +504,8 @@ public class DeviceManagementServiceImplTest {
|
|
|
|
|
.toReturn(this.deviceManagementProviderService);
|
|
|
|
|
Mockito.when(this.deviceManagementProviderService.disenrollDevice(Mockito.any(DeviceIdentifier.class)))
|
|
|
|
|
.thenThrow(new DeviceManagementException());
|
|
|
|
|
Response response = this.deviceManagementService.deleteDevice(TEST_DEVICE_TYPE, UUID.randomUUID().toString());
|
|
|
|
|
Response response = this.deviceManagementService.deleteDevice(TEST_DEVICE_TYPE, UUID.randomUUID().toString()
|
|
|
|
|
, false);
|
|
|
|
|
Assert.assertEquals(response.getStatus(), Response.Status.BAD_REQUEST.getStatusCode());
|
|
|
|
|
Mockito.reset(this.deviceManagementProviderService);
|
|
|
|
|
}
|
|
|
|
|