@Test public void createOrderWithExistingId() { int databaseSizeBeforeCreate = orderRepository.findAll().size(); order.setId(10L); given() .contentType(JSON) .body(order) .when().post("/api/orders") .then() .statusCode(400); List<Order> orderList = orderRepository.findAll(); Assertions.assertEquals(orderList.size(), databaseSizeBeforeCreate); }
@GET @Path("/orders") public Response findAll(@BeanParam PageableImpl pageable) { LOGGER.debug("REST request to get all Users"); return Response.ok().entity(orderService.findAll(pageable)).build(); }
OrderResource { @GET @Path("/orders") public Response findAll(@BeanParam PageableImpl pageable) { LOGGER.debug("REST request to get all Users"); return Response.ok().entity(orderService.findAll(pageable)).build(); } }
OrderResource { @GET @Path("/orders") public Response findAll(@BeanParam PageableImpl pageable) { LOGGER.debug("REST request to get all Users"); return Response.ok().entity(orderService.findAll(pageable)).build(); } @Inject  OrderResource(OrderService orderService); }
OrderResource { @GET @Path("/orders") public Response findAll(@BeanParam PageableImpl pageable) { LOGGER.debug("REST request to get all Users"); return Response.ok().entity(orderService.findAll(pageable)).build(); } @Inject  OrderResource(OrderService orderService); @GET @Path("/orders") Response findAll(@BeanParam PageableImpl pageable); @GET @Path("/orders/me") Response findMyData(); @GET @Path("/orders/{id}") Response findById(@PathParam("id") long id); @POST @Path("/orders") Response create(OrderDTO orderDTO); @DELETE @Path("/orders/{id}") Response delete(@PathParam("id") long id); }
OrderResource { @GET @Path("/orders") public Response findAll(@BeanParam PageableImpl pageable) { LOGGER.debug("REST request to get all Users"); return Response.ok().entity(orderService.findAll(pageable)).build(); } @Inject  OrderResource(OrderService orderService); @GET @Path("/orders") Response findAll(@BeanParam PageableImpl pageable); @GET @Path("/orders/me") Response findMyData(); @GET @Path("/orders/{id}") Response findById(@PathParam("id") long id); @POST @Path("/orders") Response create(OrderDTO orderDTO); @DELETE @Path("/orders/{id}") Response delete(@PathParam("id") long id);  }