List of usage examples for org.springframework.http HttpStatus OK
HttpStatus OK
To view the source code for org.springframework.http HttpStatus OK.
Click Source Link
From source file:com.nebhale.devoxx2013.web.DoorController.java
@RequestMapping(method = RequestMethod.GET, value = "/{door}", produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.OK) @Transactional(readOnly = true)//from ww w. j a v a 2 s . com Resource<Door> read(@PathVariable Door door) { Assert.notNull(door); return this.resourceAssembler.toResource(door); }
From source file:org.avidj.zuul.rs.ZuulTest.java
@Test public void itShallCreateShallowWriteLockOnRoot() { final Zuul zuul = createZuul(); given().standaloneSetup(zuul).param("t", "w").param("s", "s").when().put("/s/1/").then() .statusCode(HttpStatus.CREATED.value()); given().standaloneSetup(zuul).when().get("/s/1/").then().statusCode(HttpStatus.OK.value()).and() .body("key", hasItem(Collections.emptyList())).and().body("session", hasItem("1")).and() .body("type", hasItem("WRITE")).and().body("scope", hasItem("SHALLOW")).and() .body("count", hasItem(1)); }
From source file:com.consol.citrus.samples.bakery.RouteMessagesHttpIT.java
@CitrusTest public void routeMessagesContentBased() { http().client(bakeryClient).send().post("/order").contentType("application/json").payload( "{ \"order\": { \"type\": \"chocolate\", \"id\": citrus:randomNumber(10), \"amount\": 1}}"); http().client(bakeryClient).receive().response(HttpStatus.OK).messageType(MessageType.PLAINTEXT); receive(workerChocolateEndpoint)/*w w w. j a v a 2 s . c o m*/ .payload("<order><type>chocolate</type><id>@ignore@</id><amount>1</amount></order>"); http().client(bakeryClient).send().post("/order").contentType("application/json") .payload("{ \"order\": { \"type\": \"caramel\", \"id\": citrus:randomNumber(10), \"amount\": 1}}"); http().client(bakeryClient).receive().response(HttpStatus.OK).messageType(MessageType.PLAINTEXT); receive(workerCaramelEndpoint) .payload("<order><type>caramel</type><id>@ignore@</id><amount>1</amount></order>"); http().client(bakeryClient).send().post("/order").contentType("application/json").payload( "{ \"order\": { \"type\": \"blueberry\", \"id\": citrus:randomNumber(10), \"amount\": 1}}"); http().client(bakeryClient).receive().response(HttpStatus.OK).messageType(MessageType.PLAINTEXT); receive(workerBlueberryEndpoint) .payload("<order><type>blueberry</type><id>@ignore@</id><amount>1</amount></order>"); }
From source file:gt.dakaik.rest.impl.ForumImpl.java
@Override public ResponseEntity<Forum> findByUser(int idUsuario, String token, int page, int idUserProfile) throws EntidadNoEncontradaException { Pageable p = new PageRequest(page, 40); return new ResponseEntity(repoForum.findByUser(idUserProfile, p), HttpStatus.OK); }
From source file:com.acc.storefront.controllers.cms.CMSPageUrlResolvingController.java
@ResponseStatus(value = HttpStatus.OK) @ResponseBody/*from ww w.jav a 2 s . c o m*/ @RequestMapping(method = RequestMethod.GET) public String resolve( @RequestParam(Cms2Constants.RESOLVE_PAGE_URL_TICKET_ID) final String cmsPageResolveTicketId) { final PreviewDataModel previewDataModel = getPreviewData(cmsPageResolveTicketId); return resolver.resolve(previewDataModel); }
From source file:com.springsource.html5expense.controllers.ExpenseController.java
@RequestMapping(value = "/expense/{expenseId}", method = RequestMethod.DELETE, produces = "application/json") @ResponseStatus(HttpStatus.OK) public void deleteExpense(@PathVariable("expenseId") Long expenseId) { expenseService.deleteExpense(expenseId); }
From source file:com.baidu.stqa.signet.web.action.PropertyAction.java
/** * ??/*from www . ja v a 2s.c o m*/ * * @param projectId * @param key * @return */ @RequestMapping(value = "/project/{projectId}/property", method = RequestMethod.GET) @ResponseBody public ResponseEntity<Map<String, Object>> queryProperty(@PathVariable long projectId, String key) { doLog(projectId); Map<String, Object> propertyMap = new HashMap<String, Object>(); if (key == null) { propertyMap = propertyService.queryProperty(projectId); } else { String value = propertyService.queryProperty(projectId, key); propertyMap.put(key, value); } return new ResponseEntity<Map<String, Object>>(propertyMap, HttpStatus.OK); }
From source file:org.ng200.openolympus.controller.auth.OpenOlympusAuthenticationFailureHandler.java
@Override public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException { response.setContentType("application/json"); response.setStatus(HttpStatus.OK.value()); AuthenticationResponder.writeLoginStatusJson(response.getWriter(), "failed", null); }
From source file:com.eg.hello.HelloWorldConfigurationTests.java
@Test public void testGreeting() throws Exception { @SuppressWarnings("rawtypes") ResponseEntity<Map> entity = new TestRestTemplate() .getForEntity("http://localhost:" + this.port + "/hello-world", Map.class); assertEquals(HttpStatus.OK, entity.getStatusCode()); }
From source file:edu.sjsu.cmpe275.project.controller.OrderController.java
@RequestMapping(value = "/{id}", method = RequestMethod.GET) public ResponseEntity<?> get(@PathVariable(value = "id") Long id) { return new ResponseEntity<Object>(orderService.get(id), HttpStatus.OK); }