RegistrationTemplate implements RegistrationOperations { public AndroidDevice getAndroidDevice(String apid) { return restOperations.getForObject(APIDS_URL + apid, AndroidDevice.class); } RegistrationTemplate(RestOperations restOperations); void registerIOSDevice(IOSDeviceConfig deviceConfig); void registerAndroidDevice(AndroidDeviceConfig deviceConfig); void registerBlackberryDevice(BlackberryDeviceConfig deviceConfig); IOSDevice getIOSDevice(String deviceToken); AndroidDevice getAndroidDevice(String apid); BlackberryDevice getBlackberryDevice(String devicePin); void removeIOSDevice(String deviceToken); void removeAndroidDevice(String apid); void removeBlackberryDevice(String devicePin);  }
@Test public void getAndroidDevice() { mockServer.expect(requestTo("https: .andExpect(method(GET)) .andRespond(withResponse(jsonResource("data/device-android"), responseHeaders, HttpStatus.OK, "OK")); AndroidDevice device = urbanAirship.registrationOperations().getAndroidDevice("apid1"); assertEquals(1, device.getApids().size()); assertEquals("apid1", device.getApids().get(0)); assertEquals("myalias", device.getAlias()); assertTrue(device.isActive()); assertEquals(2, device.getTags().size()); assertEquals("tag1", device.getTags().get(0)); assertEquals("tag2", device.getTags().get(1)); mockServer.verify(); }