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:com.consol.citrus.demo.devoxx.ReportSummaryIT.java

@CitrusTest
public void getJsonReport() {
    echo("Receive Json report");

    http().client(reportingClient).get("/reporting/json");

    http().client(reportingClient).response(HttpStatus.OK).messageType(MessageType.JSON).payload(
            "{\"caramel\": \"@isNumber()@\",\"blueberry\": \"@isNumber()@\",\"chocolate\": \"@isNumber()@\"}");
}

From source file:uta.ak.usttmp.console.controller.RestCheckController.java

@RequestMapping(value = "/foo/{id}", method = RequestMethod.GET, produces = MediaType.TEXT_PLAIN_VALUE)
public ResponseEntity<String> getFoo(@PathVariable("id") long id) {
    System.out.println("Fetching User with id " + id);
    //        Foo foo=new Foo();
    //        foo.setId(id);
    //        foo.setName("DFGHH");
    //        foo.setEmail("qwertyui@163.com");
    return new ResponseEntity<String>("I am a foo " + id, HttpStatus.OK);
}

From source file:com.opensearchserver.hadse.cluster.ClusterController.java

/**
 * The list of registered nodes in the cluster
 * /*from  ww  w .  j  a va 2s  .c om*/
 * @return
 */
@RequestMapping(method = RequestMethod.GET, value = "/_cluster")
@ResponseBody
public HttpEntity<?> get() {
    return new ResponseEntity<Collection<NodeItem>>(ClusterCatalog.get(), HttpStatus.OK);

}

From source file:net.orpiske.tcs.service.rest.controller.TagCloudQueriesController.java

@RequestMapping(method = RequestMethod.GET)
@ResponseStatus(HttpStatus.OK)
@ResponseBody//from  ww  w.jav a  2s  .  co  m
public TagCloud requestTagCloud() {
    if (logger.isDebugEnabled()) {
        logger.debug("TagCloud command controller handling a tag cloud request");
    }

    TagCloudEvent tagCloudEvent = tagCloudService.requestTagCloud(new RequestTagCloudEvent());

    return tagCloudEvent.getCspTagCloud();
}

From source file:com.xinferin.controller.CustomerController.java

@RequestMapping(value = "/{customerId}", method = RequestMethod.GET)
@ResponseStatus(HttpStatus.OK)
public Customer getCustomer(@PathVariable int customerId) {
    return daoCustomer.get(customerId);
}

From source file:com.consol.citrus.samples.bakery.ReportSummaryIT.java

@CitrusTest
public void getJsonReport() {
    echo("Receive Json report");

    http().client(reportingClient).send().get("/reporting/json");

    http().client(reportingClient).receive().response(HttpStatus.OK).messageType(MessageType.JSON).payload(
            "{\"caramel\": \"@isNumber()@\",\"blueberry\": \"@isNumber()@\",\"chocolate\": \"@isNumber()@\"}");
}

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

@Override
public ResponseEntity<UserProfile> findAll(int idUsuario, String token) throws EntidadNoEncontradaException {
    return new ResponseEntity(repoUserProfile.findAll(), HttpStatus.OK);
}

From source file:cr.ac.siua.tec.controllers.ExportController.java

/**
 * Method for incoming RT export requests.
 * It takes ticket Id as a parameter and returns JSON with a base64 encoded PDF.
 *///  w w  w.ja  v a 2  s .  c o  m
@CrossOrigin(origins = "http://rt.tec.siua.ac.cr")
@RequestMapping(value = "/export", method = RequestMethod.GET)
public ResponseEntity<HashMap<String, String>> export(@RequestParam("ticketId") String ticketId) {
    HashMap<String, String> ticketContent = rtService.getTicket(ticketId); //Fills hashmap with ticket customFields.
    HashMap<String, String> responseMap = new HashMap<>();
    if (ticketContent != null) {
        String pdfContent = exportService.getPDF(ticketContent);
        responseMap.put("content", pdfContent);
    } else {
        responseMap.put("content", "RT Server is down.");
    }
    return new ResponseEntity<>(responseMap, HttpStatus.OK);
}

From source file:org.kurento.repository.test.TimeoutTests.java

@Test
public void playerAutoTerminationTest() throws Exception {

    String id = uploadFile(new File("test-files/sample.txt"));

    log.info("File uploaded");

    RepositoryHttpPlayer player = getRepository().findRepositoryItemById(id).createRepositoryHttpPlayer();

    player.setAutoTerminationTimeout(1000);

    RestTemplate template = getRestTemplate();

    assertEquals(HttpStatus.OK, template.getForEntity(player.getURL(), byte[].class).getStatusCode());
    log.info("Request 1 Passed");

    Thread.sleep(300);/*from   www .  j a v a  2 s .  c o m*/

    assertEquals(HttpStatus.OK, template.getForEntity(player.getURL(), byte[].class).getStatusCode());
    log.info("Request 2 Passed");

    Thread.sleep(1500);

    assertEquals(HttpStatus.NOT_FOUND, template.getForEntity(player.getURL(), byte[].class).getStatusCode());
    log.info("Request 3 Passed");

}

From source file:springfox.documentation.spring.web.dummy.controllers.ControllerWithNoRequestMappingService.java

@RequestMapping(value = "/no-request-mapping", method = RequestMethod.GET)
public ResponseEntity<Example> exampleWithNoRequestMapping(UriComponentsBuilder builder) {
    return new ResponseEntity<Example>(new Example("Hello", 1, EnumType.ONE, new NestedType("test")),
            HttpStatus.OK);
}