コード例 #1
0
 @Test
 public void insertNews() {
   NewsPojo pojo = new NewsPojo();
   pojo.setHeader("Test Header");
   pojo.setShortDescription("Test Description");
   Response res =
       target("v1/news").request().post(Entity.entity(pojo, MediaType.APPLICATION_JSON));
   Assert.assertEquals(200, res.getStatus());
 }
コード例 #2
0
 @Test
 public void putSpecificNewsEntry() {
   NewsPojo pojo = new NewsPojo();
   pojo.setHeader("Test Header");
   pojo.setShortDescription("Test Description");
   pojo.setId(UUID.fromString("5731d173-063f-4921-99dd-9e417d64171a"));
   Response res =
       target("v1/news/5731d173-063f-4921-99dd-9e417d64171a")
           .request()
           .put(Entity.entity(pojo, MediaType.APPLICATION_JSON));
   Assert.assertEquals(200, res.getStatus());
 }