mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Fix tests related to deleteDevice API
This commit is contained in:
parent
52e971de76
commit
1f001b09f1
@ -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);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user