### Question:
ProjectionController implements Constants { @RequestMapping(path = "/v1/getPatchingProgressByDirector", method = RequestMethod.POST) public ResponseEntity<Object> patchingProgressByDirector(@RequestBody(required = false) Request request) { String assetGroup = request.getAg(); if (Strings.isNullOrEmpty(assetGroup)) { return ResponseUtils.buildFailureResponse(new ServiceException(ASSET_MANDATORY)); } PatchingProgressResponse response; try { response = projectionService.getPatchingProgressByDirector(assetGroup); } catch (ServiceException e) { return ResponseUtils.buildFailureResponse(e); } return ResponseUtils.buildSucessResponse(response); }  @RequestMapping(path = "/v1/getprojection", method = RequestMethod.GET) ResponseEntity<Object> getProjectionData(
            @RequestParam(name = "targettype", required = true) String targetType,
            @RequestParam(name = "year", required = true) int year,
            @RequestParam(name = "quarter", required = true) int quarter); @ApiOperation(httpMethod = "POST", value = "Save or Update Projection Details") @PostMapping(value = "/v1/updateprojection") ResponseEntity<Object> updateProjectionData(@RequestBody ProjectionRequest projectionRequest); @RequestMapping(path = "/v1/getPatchingAndProjectionProgress", method = RequestMethod.GET) ResponseEntity<Object> getPatchingAndProjectionProgress(
            @RequestParam(name = "ag", required = true) String assetGroup); @RequestMapping(path = "/v1/getPatchingProgressByDirector", method = RequestMethod.POST) ResponseEntity<Object> patchingProgressByDirector(@RequestBody(required = false) Request request); @RequestMapping(path = "/v1/getPatchingProgressByExecutiveSponsor", method = RequestMethod.POST) ResponseEntity<Object> patchingProgressByExecutiveSponser(@RequestBody(required = false) Request request);  }### Answer:
@Test public void patchingProgressByDirectorTest() throws Exception { Request request = new Request(); Request request1 = new Request(); request.setAg("aws-all"); when(projectionService.getPatchingProgressByDirector(anyString())).thenReturn(CommonTestUtil.getPatchingProgressResponse()); assertThat(projectionController.patchingProgressByDirector(request), is(notNullValue())); assertThat(projectionController.patchingProgressByDirector(request1), is(notNullValue())); when(projectionService.getPatchingProgressByDirector(anyString())).thenThrow(new ServiceException()); ResponseEntity<Object> responseObj = projectionController.patchingProgressByDirector(request); assertTrue(responseObj.getStatusCode() == HttpStatus.EXPECTATION_FAILED); }