Search in sources :

Example 11 with Photo

use of com.linkedin.restli.example.Photo in project rest.li by linkedin.

the class TestPhotoResource method testResourceGet.

@Test
public void testResourceGet() {
    // because the test function will take arbitrary order
    // always create a photo and operate on that photo for a test function
    final Long id = createPhoto();
    // validate all data are correct
    final Photo p = _res.get(id);
    Assert.assertNotNull(p);
    Assert.assertEquals(p.getId(), id);
    Assert.assertTrue(p.hasExif());
    final EXIF e = p.getExif();
    Assert.assertTrue(e.hasLocation());
    final LatLong l = e.getLocation();
    Assert.assertEquals(l.getLatitude(), 7.0f);
    Assert.assertEquals(l.getLongitude(), 27.0f);
}
Also used : EXIF(com.linkedin.restli.example.EXIF) LatLong(com.linkedin.restli.example.LatLong) Photo(com.linkedin.restli.example.Photo) LatLong(com.linkedin.restli.example.LatLong) Test(org.testng.annotations.Test)

Aggregations

Photo (com.linkedin.restli.example.Photo)11 LatLong (com.linkedin.restli.example.LatLong)5 Test (org.testng.annotations.Test)5 EXIF (com.linkedin.restli.example.EXIF)4 UpdateResponse (com.linkedin.restli.server.UpdateResponse)4 RestLiServiceException (com.linkedin.restli.server.RestLiServiceException)2 DataProcessingException (com.linkedin.data.transform.DataProcessingException)1 Album (com.linkedin.restli.example.Album)1 BatchResult (com.linkedin.restli.server.BatchResult)1 CreateResponse (com.linkedin.restli.server.CreateResponse)1 PagingContext (com.linkedin.restli.server.PagingContext)1 Finder (com.linkedin.restli.server.annotations.Finder)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1