/**
   * Sample usage:
   *
   * <p>curl "http://localhost:10002/set-processing-time?minMs=1000&maxMs=2000"
   *
   * @param minMs
   * @param maxMs
   */
  @RequestMapping("/set-processing-time")
  public void setProcessingTime(
      @RequestParam(value = "minMs", required = true) int minMs,
      @RequestParam(value = "maxMs", required = true) int maxMs) {

    LOG.info("/set-processing-time called: {} - {} ms", minMs, maxMs);

    setProcTimeBean.setDefaultProcessingTime(minMs, maxMs);
  }
  /**
   * Sample usage: curl $HOST:$PORT/review?productId=1
   *
   * @param productId
   * @return
   */
  @RequestMapping("/review")
  public List<Review> getReviews(
      @RequestParam(value = "productId", required = true) int productId) {

    int pt = setProcTimeBean.calculateProcessingTime();
    LOG.info("/reviews called, processing time: {}", pt);

    sleep(pt);

    List<Review> list = new ArrayList<>();
    list.add(new Review(productId, 1, "Author 1", "Subject 1", "Content 1"));
    list.add(new Review(productId, 2, "Author 2", "Subject 2", "Content 2"));
    list.add(new Review(productId, 3, "Author 3", "Subject 3", "Content 3"));

    LOG.info("/reviews response size: {}", list.size());

    return list;
  }