@Test public void testCreateTask() { TaskDBResource tr = new TaskDBResource(); Task t = new Task("tache", "description", 13); tr.createTask(t); Task tache = target("/taskdb/tache").request().get(Task.class); Assert.assertEquals("tache", tache.getTitle()); }
@Test public void testAllTaskMustBeOrdered() throws InterruptedException { TaskDBResource tr = new TaskDBResource(); Task t = new Task("AAA", "descriptionA", 13); Task t2 = new Task("BBB", "descriptionB", 8); tr.createTask(t); tr.createTask(t2); List<Task> tasks = target("/taskdb/").request().get(new GenericType<List<Task>>() {}); assertEquals("AAA", tasks.get(0).getTitle()); }
@Test public void testAllTask() { TaskDBResource tr = new TaskDBResource(); Task t = new Task("tache", "description", 13); Task t2 = new Task("tache2", "description2", 8); tr.createTask(t); tr.createTask(t2); List<Task> tasks = target("/taskdb/").request().get(new GenericType<List<Task>>() {}); assertEquals(2, tasks.size()); }