Package org.springframework.boot.actuate.health

Examples of org.springframework.boot.actuate.health.Status


      // Shouldn't happen because the request mapping should not be registered
      return new ResponseEntity<Map<String, String>>(Collections.singletonMap(
          "message", "This endpoint is disabled"), HttpStatus.NOT_FOUND);
    }
    Health health = getHealth(principal);
    Status status = health.getStatus();
    if (this.statusMapping.containsKey(status.getCode())) {
      return new ResponseEntity<Health>(health, this.statusMapping.get(status
          .getCode()));
    }
    return health;
  }
View Full Code Here


    this.mvc.setStatusMapping(Collections.singletonMap("OK",
        HttpStatus.INTERNAL_SERVER_ERROR));
    Object result = this.mvc.invoke(null);
    assertTrue(result instanceof ResponseEntity);
    ResponseEntity<Health> response = (ResponseEntity<Health>) result;
    assertTrue(response.getBody().getStatus().equals(new Status("OK")));
    assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, response.getStatusCode());
  }
View Full Code Here

TOP

Related Classes of org.springframework.boot.actuate.health.Status

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.