Example usage for org.springframework.http HttpStatus OK

List of usage examples for org.springframework.http HttpStatus OK

Introduction

In this page you can find the example usage for org.springframework.http HttpStatus OK.

Prototype

HttpStatus OK

To view the source code for org.springframework.http HttpStatus OK.

Click Source Link

Document

200 OK .

Usage

From source file:springfox.documentation.swagger.web.ApiResourceController.java

@RequestMapping(value = "/configuration/security")
@ResponseBody/*w w  w .j  av  a  2s  .  c  o m*/
ResponseEntity<SecurityConfiguration> securityConfiguration() {
    return new ResponseEntity<SecurityConfiguration>(
            Optional.fromNullable(securityConfiguration).or(SecurityConfiguration.DEFAULT), HttpStatus.OK);
}

From source file:com.srinathavan.mwbng.rest.mvc.BlogController.java

/**
 * Test for simple get request to fetch all blogs
 * //from w  ww  .ja  va 2  s  .  c o m
 * @return
 */
@RequestMapping(method = RequestMethod.GET)
public @ResponseBody ResponseEntity<Object> findAllBlogs() {
    BlogList responseData = blogService.findAllBlogs();
    return new ResponseEntity<Object>(responseData, HttpStatus.OK);
}

From source file:biz.epa.jsp.SampleWebJspApplicationTests.java

@Test
public void testJspWithEl() throws Exception {
    ResponseEntity<String> entity = new TestRestTemplate().getForEntity("http://localhost:" + this.port,
            String.class);
    assertEquals(HttpStatus.OK, entity.getStatusCode());
    assertTrue("Wrong body:\n" + entity.getBody(), entity.getBody().contains("/resources/text.txt"));
}

From source file:com.ar.dev.tierra.api.controller.MetodoPagoFacturaController.java

@RequestMapping(value = "/list", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> getAll() {
    List<MetodoPagoFactura> list = facadeService.getMetodoPagoFacturaDAO().getAll();
    if (!list.isEmpty()) {
        return new ResponseEntity<>(list, HttpStatus.OK);
    } else {/*from   w  w w.j  a v a2  s. c  o  m*/
        return new ResponseEntity<>(HttpStatus.NOT_FOUND);
    }
}

From source file:io.fourfinanceit.homework.controller.LoanControler.java

@RequestMapping(value = "/loan", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Iterable<LoanApplication>> getLoanApplications() {

    Iterable<LoanApplication> loanApplications = loanApplicationRepository.findAll();

    return new ResponseEntity<Iterable<LoanApplication>>(loanApplications, HttpStatus.OK);
}

From source file:net.jkratz.igdb.controller.GenreController.java

/**
  * Returns all genres in database//from  w  ww .  j a v  a2  s .  com
  * 
  * @return List of Genre objects
  * @see Genre
  */
@RequestMapping(value = { "", "/" }, method = RequestMethod.GET)
public ResponseEntity<List<Genre>> getGenres() {
    List<Genre> genres = genreRepository.findAll();

    return new ResponseEntity<>(genres, HttpStatus.OK);
}

From source file:org.busko.routemanager.web.RoutePlotterController.java

@RequestMapping(method = RequestMethod.GET)
public ResponseEntity<byte[]> handheldApk(Model uiModel, HttpServletRequest httpServletRequest)
        throws Exception {
    InputStream input = getClass().getClassLoader().getResourceAsStream("BuskoPlotter.apk");
    int fileSize = input.available();
    byte[] bytes = new byte[fileSize];
    input.read(bytes);//from w  w w  .ja  v a 2  s.c  o m
    input.close();

    HttpHeaders responseHeaders = new HttpHeaders();
    responseHeaders.set("Content-Disposition", "attachment;filename=BuskoPlotter.apk");
    responseHeaders.set("Content-Length", Integer.toString(fileSize));
    responseHeaders.set("Content-Type", "application/vnd.android.package-archive");
    return new ResponseEntity<byte[]>(bytes, responseHeaders, HttpStatus.OK);
}

From source file:es.galvarez.rest.config.AuthController.java

@RequestMapping("/auth")
public HttpEntity<String> auth() {
    return new ResponseEntity<String>(HttpStatus.OK);
}

From source file:com.batch.traditional.SampleTraditionalApplicationTests.java

@Test
public void testHomeJsp() throws Exception {
    ResponseEntity<String> entity = new TestRestTemplate().getForEntity("http://localhost:" + this.port,
            String.class);
    assertEquals(HttpStatus.OK, entity.getStatusCode());
    String body = entity.getBody();
    assertTrue("Wrong body:\n" + body, body.contains("<html>"));
    assertTrue("Wrong body:\n" + body, body.contains("<h1>Home</h1>"));
}

From source file:org.obp.web.DefaultsController.java

@RequestMapping("/secure/defaults/update")
public ResponseEntity updateDefaultValue(@RequestParam String name, @RequestParam String value) {
    try {/*from   w  ww. ja  va  2  s.  c o m*/
        defaultDataInstrument.updateReadout(name, new Double(value));
    } catch (Exception e) {
        return new ResponseEntity(HttpStatus.BAD_REQUEST);
    }
    return new ResponseEntity(HttpStatus.OK);
}