AutoEnrollmentController { @ExceptionHandler({ CloudFoundryException.class }) public ResponseEntity<Object> handleCloudFoundryException(CloudFoundryException cfe, HttpServletResponse response) { return new ResponseEntity<>(cfe, HttpStatus.INTERNAL_SERVER_ERROR); }  @RequestMapping(method = RequestMethod.GET, value = "/{organizationId}") ResponseEntity<OrgEnrollmentConfig> getEnrolledOrganization(
            @PathVariable String organizationId); @RequestMapping(method = RequestMethod.DELETE, value = "/{organizationId}") ResponseEntity<OrgEnrollmentConfig> deleteOrganization(
            @PathVariable String organizationId); @RequestMapping(method = RequestMethod.PUT, value = "{organizationId}") ResponseEntity<OrgEnrollmentConfig> enrolOrganization(
            @PathVariable String organizationId,
            @Valid @RequestBody OrgEnrollmentConfigRequest orgEnrollerConfigRequest,
            BindingResult result); @InitBinder void initBinder(WebDataBinder binder); @ExceptionHandler({ CloudFoundryException.class }) ResponseEntity<Object> handleCloudFoundryException(CloudFoundryException cfe,
            HttpServletResponse response); @ExceptionHandler({ BindException.class }) ResponseEntity<List<ObjectError>> handleBindException(BindException be,
            HttpServletResponse response);  }
@Test public void test_handleCloudFoundryException_returns_not_found() throws Exception { CloudFoundryException cfe = mock(CloudFoundryException.class); HttpServletResponse response = mock(HttpServletResponse.class); ResponseEntity<Object> errorResponseEntity = autoEnrollmentController .handleCloudFoundryException(cfe, response); assertTrue(errorResponseEntity.getStatusCode() == HttpStatus.INTERNAL_SERVER_ERROR); }