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.baidu.stqa.signet.web.action.AuthorityAction.java
/** * ??/*from w w w . j a v a 2 s.c om*/ * * @param projectId * @param storyId * @return */ @RequestMapping(value = "/project/{projectId}/story/{storyId}/authority", method = RequestMethod.POST) @ResponseBody public ResponseEntity<EditStatus> applyAuthorityAction(@PathVariable long projectId, @PathVariable long storyId) { doLog(projectId); String user = getUser(); EditStatus es = caseSuiteService.ApplyForEdit(projectId, storyId, user, ""); return new ResponseEntity<EditStatus>(es, HttpStatus.OK); }
From source file:com.javiermoreno.springboot.rest.PrivateController.java
@RequestMapping(value = "test", method = RequestMethod.GET) @ResponseStatus(HttpStatus.OK) @ApiOperation(value = "Testear seguridad", notes = "Permite comprobar el acceso al api privada.") String[] home() {//from w w w .j a v a 2s . c om counterService.increment("counter.ctrl.private.invoked"); return new String[] { "Ok, puedes acceder a la parte privada." }; }
From source file:com.baidu.terminator.manager.action.StubAction.java
@RequestMapping(value = "/{linkId}", method = RequestMethod.GET) @ResponseBody// w w w.j av a 2 s . co m public ResponseEntity<List<StubData>> listStubData(@PathVariable int linkId) { List<StubData> stubData = stubService.getStubData(linkId); return new ResponseEntity<List<StubData>>(stubData, HttpStatus.OK); }
From source file:com.capside.enterpriseseminar.DemoAPIIT.java
@Test public void testGetStatisticsWithDTO() { final String localTeamName = "R. Madrid"; final String visitorTeamName = "Barcelona"; ResponseEntity<ApiCtrl.StatisticsDTO> response = restTemplate.exchange( "/games/stats/{firstTeam:.*}-vs-{secondTeam:.*}", HttpMethod.GET, null, ApiCtrl.StatisticsDTO.class, localTeamName, visitorTeamName); assertEquals("Invocation was a success.", HttpStatus.OK, response.getStatusCode()); assertEquals("Local team", localTeamName, response.getBody().getStatistics().getFirstTeam()); assertEquals("Visitor team", visitorTeamName, response.getBody().getStatistics().getSecondTeam()); }
From source file:sample.resteasy.SampleResteasyApplicationTests.java
@Test public void synchronousRequest() { ResponseEntity<String> response = new TestRestTemplate().getForEntity("http://localhost:" + port + "/hello", String.class); assertEquals(HttpStatus.OK, response.getStatusCode()); assertEquals("Hello World", response.getBody()); }
From source file:edu.infsci2560.services.DvdsService.java
@RequestMapping(value = "/{id}", method = RequestMethod.GET, produces = "application/json") public ResponseEntity<Dvd> list(@PathVariable("id") Long id) { HttpHeaders headers = new HttpHeaders(); return new ResponseEntity<>(repository.findOne(id), headers, HttpStatus.OK); }
From source file:de.alexkrieg.IntegrationTests.java
@Test public void testAvailability() throws Exception { ResponseEntity<String> entity = new TestRestTemplate().getForEntity("http://localhost:" + this.port + "/", String.class); assertEquals(HttpStatus.OK, entity.getStatusCode()); }
From source file:edu.infsci2560.services.BookService.java
@RequestMapping(value = "/{id}", method = RequestMethod.GET, produces = "application/json") public ResponseEntity<Book> list(@PathVariable("id") Long id) { HttpHeaders headers = new HttpHeaders(); return new ResponseEntity<>(repository.findOne(id), headers, HttpStatus.OK); }
From source file:org.cloudfoundry.identity.varz.integration.VarzEndpointIntegrationTests.java
/** * tests a happy-day flow of the <code>/varz</code> endpoint *//*from w w w . ja v a 2 s .c o m*/ @Test public void testHappyDay() throws Exception { HttpHeaders headers = new HttpHeaders(); headers.add("Authorization", testAccounts.getVarzAuthorizationHeader()); ResponseEntity<String> response = serverRunning.getForString("/", headers); assertEquals(HttpStatus.OK, response.getStatusCode()); String map = response.getBody(); assertTrue(map.contains("thread_pool")); }
From source file:com.sms.server.controller.JobController.java
@RequestMapping(value = "/{id}", method = RequestMethod.GET) public ResponseEntity<Job> getJobByID(@PathVariable("id") Long id) { Job job = jobDao.getJobByID(id);/*ww w . java 2 s . c o m*/ if (job == null) { return new ResponseEntity<>(HttpStatus.NOT_FOUND); } return new ResponseEntity<>(job, HttpStatus.OK); }