merge-requests/126/head
lasanthaDLPDS 5 years ago
commit ff90a10042

@ -705,7 +705,7 @@ public class AndroidDeviceUtils {
JsonElement googlePolicyPayload = appElement.getAsJsonObject(). JsonElement googlePolicyPayload = appElement.getAsJsonObject().
get(AndroidConstants.ApplicationInstall.GOOGLE_POLICY_PAYLOAD); get(AndroidConstants.ApplicationInstall.GOOGLE_POLICY_PAYLOAD);
if (googlePolicyPayload == null) { if (googlePolicyPayload == null || googlePolicyPayload.toString().equals("\"\"")) {
uuid = appElement.getAsJsonObject(). uuid = appElement.getAsJsonObject().
get(AndroidConstants.ApplicationInstall.ENROLLMENT_APP_INSTALL_UUID).getAsString(); get(AndroidConstants.ApplicationInstall.ENROLLMENT_APP_INSTALL_UUID).getAsString();
try (CloseableHttpClient httpClient = HttpClients.createDefault()) { try (CloseableHttpClient httpClient = HttpClients.createDefault()) {

@ -196,9 +196,9 @@ public class DeviceManagementServiceTests {
mockDeviceManagementService(); mockDeviceManagementService();
mockPolicyManagerService(); mockPolicyManagerService();
mockUser(); mockUser();
Response response = androidService.enrollDevice(TestUtils.getBasicAndroidDevice()); Message message = androidService.enrollDevice(TestUtils.getBasicAndroidDevice());
Assert.assertNotNull(response); Assert.assertNotNull(message);
Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode()); Assert.assertEquals(message.getResponseCode(), Response.Status.OK.getStatusCode());
} }
@Test @Test
@ -237,9 +237,9 @@ public class DeviceManagementServiceTests {
properties.add(property); properties.add(property);
androidDevice.setProperties(properties); androidDevice.setProperties(properties);
Response response = androidService.enrollDevice(androidDevice); Message message = androidService.enrollDevice(androidDevice);
Assert.assertNotNull(response); Assert.assertNotNull(message);
Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode()); Assert.assertEquals(message.getResponseCode(), Response.Status.OK.getStatusCode());
} }
@Test @Test
@ -249,9 +249,9 @@ public class DeviceManagementServiceTests {
mockUser(); mockUser();
AndroidDevice androidDevice = TestUtils.getBasicAndroidDevice(); AndroidDevice androidDevice = TestUtils.getBasicAndroidDevice();
androidDevice.setDeviceIdentifier("1234"); androidDevice.setDeviceIdentifier("1234");
Response response = androidService.enrollDevice(androidDevice); Message message = androidService.enrollDevice(androidDevice);
Assert.assertNotNull(response); Assert.assertNotNull(message);
Assert.assertEquals(response.getStatus(), Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()); Assert.assertEquals(message.getResponseCode(), Response.Status.INTERNAL_SERVER_ERROR.getStatusCode());
} }
@Test @Test

Loading…
Cancel
Save