@Test
public void testfootprints() throws Exception {

  FootprintList list = getFootprintList("mp", null, 1);
  verifyFootprintViewsAndPositions(list, 0, 0, 0);
  list = getFootprintList("mp", "me", 1);
  verifyFootprintViewsAndPositions(list, 0, 0, 0);
  //Create the initial viewer/user event
  createAndVerifyUserAction(UserTrackingServiceImpl.FOOTPRINT_KEY, "session123", "mp", "me", "127.0.0.1", 10, 20);
  //Sanity checks
  Assert.assertEquals(1, service.getViews("mp"));
  Assert.assertEquals(0, service.getViews("other"));
  //Assert that the correct things are in the correct places.
  list = getFootprintList("mp", null, 3);
  verifyFootprintViewsAndPositions(list, 0, 0, 0);
  verifyFootprintViewsAndPositions(list, 1, 10, 1);
  verifyFootprintViewsAndPositions(list, 2, 20, 0);
  list = getFootprintList("mp", "someone else", 1);
  verifyFootprintViewsAndPositions(list, 0, 0, 0);
  list = getFootprintList("mp", "me", 3);
  verifyFootprintViewsAndPositions(list, 0, 0, 0);
  verifyFootprintViewsAndPositions(list, 1, 10, 1);
  verifyFootprintViewsAndPositions(list, 2, 20, 0);
  //Create a different viewer/user event
  createAndVerifyUserAction(UserTrackingServiceImpl.FOOTPRINT_KEY, "session456", "mp", "someone else", "127.0.01", 560, 720);
  //Sanity checks
  Assert.assertEquals(2, service.getViews("mp"));
  Assert.assertEquals(0, service.getViews("other"));
  //Assert that the correct things are in the correct places.
  list = getFootprintList("mp", null, 5);
  verifyFootprintViewsAndPositions(list, 0, 0, 0);
  verifyFootprintViewsAndPositions(list, 1, 10, 1);
  verifyFootprintViewsAndPositions(list, 2, 20, 0);
  verifyFootprintViewsAndPositions(list, 3, 560, 1);
  verifyFootprintViewsAndPositions(list, 4, 720, 0);
  list = getFootprintList("mp", "someone else", 3);
  verifyFootprintViewsAndPositions(list, 0, 0, 0);
  verifyFootprintViewsAndPositions(list, 1, 560, 1);
  verifyFootprintViewsAndPositions(list, 2, 720, 0);
  list = getFootprintList("mp", "me", 3);
  verifyFootprintViewsAndPositions(list, 0, 0, 0);
  verifyFootprintViewsAndPositions(list, 1, 10, 1);
  verifyFootprintViewsAndPositions(list, 2, 20, 0);
  //Update the first viewer/user event
  createAndVerifyUserAction(UserTrackingServiceImpl.FOOTPRINT_KEY, "session123", "mp", "me", "127.0.0.1", 20, 30);
  //Sanity checks
  Assert.assertEquals(2, service.getViews("mp"));
  Assert.assertEquals(0, service.getViews("other"));
  //Assert that the correct things are in the correct places.
  list = getFootprintList("mp", null, 5);
  verifyFootprintViewsAndPositions(list, 0, 0, 0);
  verifyFootprintViewsAndPositions(list, 1, 10, 1);
  verifyFootprintViewsAndPositions(list, 2, 30, 0);
  verifyFootprintViewsAndPositions(list, 3, 560, 1);
  verifyFootprintViewsAndPositions(list, 4, 720, 0);
  list = getFootprintList("mp", "someone else", 3);
  verifyFootprintViewsAndPositions(list, 0, 0, 0);
  verifyFootprintViewsAndPositions(list, 1, 560, 1);
  verifyFootprintViewsAndPositions(list, 2, 720, 0);
  list = getFootprintList("mp", "me", 3);
  verifyFootprintViewsAndPositions(list, 0, 0, 0);
  verifyFootprintViewsAndPositions(list, 1, 10, 1);
  verifyFootprintViewsAndPositions(list, 2, 30, 0);
  //Skip the second viewer to a new point in the video
  createAndVerifyUserAction(UserTrackingServiceImpl.FOOTPRINT_KEY, "session456", "mp", "someone else", "127.0.01", 950, 960);
  //Sanity checks
  Assert.assertEquals(2, service.getViews("mp"));
  Assert.assertEquals(0, service.getViews("other"));
  //Assert that the correct things are in the correct places.
  list = getFootprintList("mp", null, 7);
  verifyFootprintViewsAndPositions(list, 0, 0, 0);
  verifyFootprintViewsAndPositions(list, 1, 10, 1);
  verifyFootprintViewsAndPositions(list, 2, 30, 0);
  verifyFootprintViewsAndPositions(list, 3, 560, 1);
  verifyFootprintViewsAndPositions(list, 4, 720, 0);
  verifyFootprintViewsAndPositions(list, 5, 950, 1);
  verifyFootprintViewsAndPositions(list, 6, 960, 0);
  list = getFootprintList("mp", "someone else", 5);
  verifyFootprintViewsAndPositions(list, 0, 0, 0);
  verifyFootprintViewsAndPositions(list, 1, 560, 1);
  verifyFootprintViewsAndPositions(list, 2, 720, 0);
  verifyFootprintViewsAndPositions(list, 3, 950, 1);
  verifyFootprintViewsAndPositions(list, 4, 960, 0);
  list = getFootprintList("mp", "me", 3);
  verifyFootprintViewsAndPositions(list, 0, 0, 0);
  verifyFootprintViewsAndPositions(list, 1, 10, 1);
  verifyFootprintViewsAndPositions(list, 2, 30, 0);
}