GitHubApiController { @GetMapping("user/{screenName}") public ResponseEntity<User> discoverUserByScreenName(@PathVariable("screenName") String screenName) { return Optional.of(ResponseEntity.ok(gitHubService.discoverUserByScreenName(screenName))) .or(new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR)); } @Autowired  GitHubApiController(GitHubService gitHubService); @GetMapping("user/{screenName}") ResponseEntity<User> discoverUserByScreenName(@PathVariable("screenName")  String screenName);  }
@Test public void testDiscoverUserByScreenName() throws Exception { ResponseEntity<User> user1 = restTemplate.getForEntity("http: assertEquals(HttpStatus.OK, user1.getStatusCode()); ResponseEntity<User> user2 = restTemplate.getForEntity("http: assertEquals(HttpStatus.OK, user2.getStatusCode()); ResponseEntity<User> user3 = restTemplate.getForEntity("http: assertEquals(HttpStatus.OK, user3.getStatusCode()); }