assertTrue(status.isSuccessful());
}
@Test
public void testPackageAdditionRetrievalAndRemoval() throws Exception {
ReplicationQueue queue = new SimpleReplicationQueue("agentName", "default");
ReplicationQueueItem pkg = mock(ReplicationQueueItem.class);
when(pkg.getId()).thenReturn("id");
assertTrue(queue.add(pkg));
assertFalse(queue.isEmpty());
assertEquals(pkg, queue.getHead());
assertFalse(queue.isEmpty());
queue.remove(pkg.getId());
assertTrue(queue.isEmpty());
ReplicationQueueItemState status = queue.getStatus(pkg);
assertNotNull(status);
assertTrue(status.isSuccessful());
assertEquals(1, status.getAttempts());
}