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:org.camunda.bpm.spring.boot.starter.webapp.WebappEeTest.java

@Test
public void testLicenseEndpointAvailable() throws Exception {
    final ResponseEntity<String> response = testRestTemplate.getForEntity(
            "http://localhost:" + this.port + "/api/admin/plugin/license/default/key", String.class);

    assertEquals(HttpStatus.OK, response.getStatusCode());
}

From source file:uk.co.parso.barebones.TestServiceImpl.java

@RequestMapping("test")
@ResponseStatus(HttpStatus.OK)
@Transactional(readOnly = false, isolation = Isolation.SERIALIZABLE, propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
@Override/*from w w w .  java  2s.  co m*/
public void test() {
    logger.debug("TEST");
    Test test = testRepo.selectForUpdate(1L);
    Test test2 = testRepo.selectForUpdate(2L);
    test.setName("test" + (new Date()).getTime());
    test.setName("test2" + (new Date()).getTime());
}

From source file:gt.dakaik.rest.impl.CityImpl.java

@Override
public ResponseEntity<City> findById(int idUsuario, String token, Long id) throws EntidadNoEncontradaException {
    City p = repoCity.findOne(id);/*from  w  w w . j a  va2 s . c om*/

    if (p != null) {
        return new ResponseEntity(p, HttpStatus.OK);
    } else {
        throw new EntidadNoEncontradaException("Entity User");
    }
}

From source file:com.github.sebhoss.identifier.usecases.IndexPagesIT.java

/**
 * Ensures that the index page can be access at <code>/</code>.
 *
 * @throws Exception/* w  w w . j a  v  a2s .c o  m*/
 *             In case something goes wrong.
 */
@Test
public void shouldGetIndexPage() throws Exception {
    final ResponseEntity<String> response = fetchString("/"); //$NON-NLS-1$
    assertThat(response.getStatusCode(), equalTo(HttpStatus.OK));
}

From source file:unitTestTutorials.BlogEntryController.java

@ResponseStatus(HttpStatus.OK)
@RequestMapping(method = RequestMethod.POST)
public @ResponseBody BlogEntry postTest(@RequestBody BlogEntry blogEntry) {
    return blogEntry;
}

From source file:be.boyenvaesen.RestControllers.HumidityRestController.java

@RequestMapping("/humidity/minute")
@ResponseBody/*  w w  w.  ja va2 s  .co  m*/
public ResponseEntity<List<HumidityByMinute>> getByMinute() {

    return new ResponseEntity<>(
            service.getBetweenDatesByInterval(HumidityByMinute.class, new Date(1476391394000L), new Date()),
            HttpStatus.OK);

}

From source file:gt.dakaik.rest.impl.StateImpl.java

@Override
public ResponseEntity<State> findById(int idUsuario, String token, Long id)
        throws EntidadNoEncontradaException {
    State p = repoState.findOne(id);

    if (p != null) {
        return new ResponseEntity(p, HttpStatus.OK);
    } else {/*from w  w w . j  a v a 2 s.c o  m*/
        throw new EntidadNoEncontradaException("Entity User");
    }
}

From source file:com.boxedfolder.carrot.web.PingResource.java

@ResponseStatus(HttpStatus.OK)
@RequestMapping(value = "/client/ping", method = RequestMethod.GET)
public String ping() {
    return "Ping. (Secured)";
}

From source file:nu.yona.server.rest.ControllerBase.java

protected <T> ResponseEntity<T> createOkResponse() {
    return createResponse(HttpStatus.OK);
}

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

@RequestMapping(value = "/list", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> getAll() {
    List<Sexo> sexo = facadeService.getSexoDAO().getAll();
    if (!sexo.isEmpty()) {
        return new ResponseEntity<>(sexo, HttpStatus.OK);
    } else {/*from   w ww. j  av  a 2 s.  c om*/
        return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
    }
}