@Test(priority = 1) @RunAsClient public void testCreateCard() throws Exception { WebTarget path = client.target(this.uri).path(PATH); Response response = path .request(MediaType.APPLICATION_JSON_TYPE) .accept(MediaType.APPLICATION_JSON_TYPE) .post(Entity.entity(testCard, MediaType.APPLICATION_JSON_TYPE), Response.class); Assert.assertEquals(response.getStatus(), 201, "Url = " + path.getUri()); URI location = response.getLocation(); Assert.assertNotNull(location); Card createdCard = client.target(location) .request(MediaType.APPLICATION_JSON_TYPE) .get(Card.class); Assert.assertNotNull(createdCard.getId()); Assert.assertEquals(createdCard.getTitle(), testCard.getTitle()); this.testCard = createdCard; }
@POST @ApiOperation(value = "Create a new Card", notes = "Create a card using json") public Response createCard(Card card){ card = cardService.createCard(card); return Response.created(getGetUri(card)).build(); }
CardRestApi { @POST @ApiOperation(value = "Create a new Card", notes = "Create a card using json") public Response createCard(Card card){ card = cardService.createCard(card); return Response.created(getGetUri(card)).build(); } }
CardRestApi { @POST @ApiOperation(value = "Create a new Card", notes = "Create a card using json") public Response createCard(Card card){ card = cardService.createCard(card); return Response.created(getGetUri(card)).build(); }  }
CardRestApi { @POST @ApiOperation(value = "Create a new Card", notes = "Create a card using json") public Response createCard(Card card){ card = cardService.createCard(card); return Response.created(getGetUri(card)).build(); }  @POST @ApiOperation(value = "Create a new Card", notes = "Create a card using json") Response createCard(Card card); @PUT @ApiOperation(value = "Update a new Card", notes = "Update a card using json") Response updateCard(Card card); @GET @Path("/{id}") @ApiOperation(value = "Get a Card", notes = "Get a card using an Id", response = Card.class) Response getCard(@PathParam("id") Long id); @DELETE @Path("/{id}") @ApiOperation(value = "Delete a Card", notes = "Delete a card with an Id") Response removeCard(@PathParam("id") Long id); @GET @ApiOperation(value = "Get all cards", notes = "Get all cards in json") Response getCards(); }
CardRestApi { @POST @ApiOperation(value = "Create a new Card", notes = "Create a card using json") public Response createCard(Card card){ card = cardService.createCard(card); return Response.created(getGetUri(card)).build(); }  @POST @ApiOperation(value = "Create a new Card", notes = "Create a card using json") Response createCard(Card card); @PUT @ApiOperation(value = "Update a new Card", notes = "Update a card using json") Response updateCard(Card card); @GET @Path("/{id}") @ApiOperation(value = "Get a Card", notes = "Get a card using an Id", response = Card.class) Response getCard(@PathParam("id") Long id); @DELETE @Path("/{id}") @ApiOperation(value = "Delete a Card", notes = "Delete a card with an Id") Response removeCard(@PathParam("id") Long id); @GET @ApiOperation(value = "Get all cards", notes = "Get all cards in json") Response getCards();  }