@Test(description = "Testing delete device when unable to delete device.")
public void testDeleteDeviceException() throws DeviceManagementException {

    PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getDeviceManagementService"))
            .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());
    Assert.assertEquals(response.getStatus(), Response.Status.BAD_REQUEST.getStatusCode());
    Mockito.reset(this.deviceManagementProviderService);
}