@Test public void testFindResource() { Sample r = new Sample("toto"); r = (Sample) this.request("service-based").xmlPost(r).resource(r.getClass()); Response response = this.request("service-based/" + r.getId()).get(); Assertions.assertThat(response.getStatus()).isEqualTo(Http.OK); }
@Test(expectedExceptions = {NotImplementedClientException.class}) public void testFindAllResourcesUnpaginated() { this.request("service-based").jsonPost(new Sample("toto")); this.request("service-based").jsonPost(new Sample("toto")); Response r = this.request("service-based").setQueryParameter("page", "no").getXml(); Assertions.assertThat(r).isNotNull(); Assertions.assertThat(r.getStatus()).isEqualTo(Http.NOT_IMPLEMENTED); }
@Test(expectedExceptions = {NotFoundClientException.class}) public void testDeleteResource() { Sample r = new Sample("toto"); r = this.request("service-based").xmlPost(r).resource(r.getClass()); Assertions.assertThat(r).isNotNull(); Response response = this.request("service-based/" + r.getId()).delete(); Assertions.assertThat(response.getStatus()).isEqualTo(Http.NO_CONTENT); this.request("service-based/" + r.getId()).get(); }