test_class.declarator: emrRestController
test_class.modifier: @InjectMocks
      private
test_class.original_string: @InjectMocks
      private EmrRestController emrRestController;
test_class.type: EmrRestController
test_class.var_name: emrRestController
test_class.declarator: emrService
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private EmrService emrService;
test_class.type: EmrService
test_class.var_name: emrService
test_class.file: herd-code/herd-rest/src/test/java/org/finra/herd/rest/EmrRestControllerTest.java
test_class.identifier: EmrRestControllerTest
test_class.superclass: extends AbstractRestTest
test_case.body: @Test
      public void testTerminateEmrCluster() throws Exception
      {
          // Create an EMR cluster key.
          EmrClusterAlternateKeyDto emrClusterAlternateKeyDto = new EmrClusterAlternateKeyDto(NAMESPACE, EMR_CLUSTER_DEFINITION_NAME, EMR_CLUSTER_NAME);
  
          // Create an EMR cluster.
          EmrCluster emrCluster = new EmrCluster();
          emrCluster.setId(EMR_CLUSTER_ID);
  
          // Mock the external calls.
          when(emrService.terminateCluster(emrClusterAlternateKeyDto, OVERRIDE_TERMINATION_PROTECTION, EMR_CLUSTER_ID, AWS_ACCOUNT_ID)).thenReturn(emrCluster);
  
          // Call the method under test.
          EmrCluster result = emrRestController
              .terminateEmrCluster(NAMESPACE, EMR_CLUSTER_DEFINITION_NAME, EMR_CLUSTER_NAME, OVERRIDE_TERMINATION_PROTECTION, EMR_CLUSTER_ID, AWS_ACCOUNT_ID);
  
          // Verify the external calls.
          verify(emrService).terminateCluster(emrClusterAlternateKeyDto, OVERRIDE_TERMINATION_PROTECTION, EMR_CLUSTER_ID, AWS_ACCOUNT_ID);
          verifyNoMoreInteractionsHelper();
  
          // Validate the results.
          assertEquals(emrCluster, result);
      }
test_case.class_method_signature: EmrRestControllerTest.testTerminateEmrCluster()
test_case.full_signature: @Test public void testTerminateEmrCluster()
test_case.identifier: testTerminateEmrCluster
test_case.invocations: setId thenReturn when terminateCluster terminateEmrCluster terminateCluster verify verifyNoMoreInteractionsHelper assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testTerminateEmrCluster()
focal_class.declarator: emrService
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private EmrService emrService;
focal_class.type: EmrService
focal_class.var_name: emrService
focal_class.file: herd-code/herd-rest/src/main/java/org/finra/herd/rest/EmrRestController.java
focal_class.identifier: EmrRestController
focal_class.class_method_signature: EmrRestController.addHadoopJarStepToEmrCluster(@RequestBody EmrHadoopJarStepAddRequest request)
focal_class.full_signature: @RequestMapping(value = "/emrHadoopJarSteps", method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_EMR_HADOOP_JAR_STEPS_POST) public EmrHadoopJarStep addHadoopJarStepToEmrCluster(@RequestBody EmrHadoopJarStepAddRequest request)
focal_class.identifier: addHadoopJarStepToEmrCluster
focal_class.modifiers: @RequestMapping(value = "/emrHadoopJarSteps", method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_EMR_HADOOP_JAR_STEPS_POST) public
focal_class.parameters: (@RequestBody EmrHadoopJarStepAddRequest request)
focal_class.return: EmrHadoopJarStep
focal_class.signature: EmrHadoopJarStep addHadoopJarStepToEmrCluster(@RequestBody EmrHadoopJarStepAddRequest request)
focal_class.class_method_signature: EmrRestController.addHiveStepToEmrCluster(@RequestBody EmrHiveStepAddRequest request)
focal_class.full_signature: @RequestMapping(value = "/emrHiveSteps", method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_EMR_HIVE_STEPS_POST) public EmrHiveStep addHiveStepToEmrCluster(@RequestBody EmrHiveStepAddRequest request)
focal_class.identifier: addHiveStepToEmrCluster
focal_class.modifiers: @RequestMapping(value = "/emrHiveSteps", method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_EMR_HIVE_STEPS_POST) public
focal_class.parameters: (@RequestBody EmrHiveStepAddRequest request)
focal_class.return: EmrHiveStep
focal_class.signature: EmrHiveStep addHiveStepToEmrCluster(@RequestBody EmrHiveStepAddRequest request)
focal_class.class_method_signature: EmrRestController.addPigStepToEmrCluster(@RequestBody EmrPigStepAddRequest request)
focal_class.full_signature: @RequestMapping(value = "/emrPigSteps", method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_EMR_PIG_STEPS_POST) public EmrPigStep addPigStepToEmrCluster(@RequestBody EmrPigStepAddRequest request)
focal_class.identifier: addPigStepToEmrCluster
focal_class.modifiers: @RequestMapping(value = "/emrPigSteps", method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_EMR_PIG_STEPS_POST) public
focal_class.parameters: (@RequestBody EmrPigStepAddRequest request)
focal_class.return: EmrPigStep
focal_class.signature: EmrPigStep addPigStepToEmrCluster(@RequestBody EmrPigStepAddRequest request)
focal_class.class_method_signature: EmrRestController.addShellStepToEmrCluster(@RequestBody EmrShellStepAddRequest request)
focal_class.full_signature: @RequestMapping(value = "/emrShellSteps", method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_EMR_SHELL_STEPS_POST) public EmrShellStep addShellStepToEmrCluster(@RequestBody EmrShellStepAddRequest request)
focal_class.identifier: addShellStepToEmrCluster
focal_class.modifiers: @RequestMapping(value = "/emrShellSteps", method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_EMR_SHELL_STEPS_POST) public
focal_class.parameters: (@RequestBody EmrShellStepAddRequest request)
focal_class.return: EmrShellStep
focal_class.signature: EmrShellStep addShellStepToEmrCluster(@RequestBody EmrShellStepAddRequest request)
focal_class.class_method_signature: EmrRestController.createEmrCluster(@RequestBody EmrClusterCreateRequest request)
focal_class.full_signature: @RequestMapping(value = "/emrClusters", method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_EMR_CLUSTERS_POST) public EmrCluster createEmrCluster(@RequestBody EmrClusterCreateRequest request)
focal_class.identifier: createEmrCluster
focal_class.modifiers: @RequestMapping(value = "/emrClusters", method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_EMR_CLUSTERS_POST) public
focal_class.parameters: (@RequestBody EmrClusterCreateRequest request)
focal_class.return: EmrCluster
focal_class.signature: EmrCluster createEmrCluster(@RequestBody EmrClusterCreateRequest request)
focal_class.class_method_signature: EmrRestController.getEmrCluster(@PathVariable("namespace") String namespace, @PathVariable("emrClusterDefinitionName") String emrClusterDefinitionName,
          @PathVariable("emrClusterName") String emrClusterName, @RequestParam(value = "emrClusterId", required = false) String emrClusterId,
          @RequestParam(value = "emrStepId", required = false) String emrStepId,
          @RequestParam(value = "verbose", required = false, defaultValue = "false") Boolean verbose,
          @RequestParam(value = "accountId", required = false) String accountId,
          @RequestParam(value = "retrieveInstanceFleets", required = false, defaultValue = "false") Boolean retrieveInstanceFleets)
focal_class.full_signature: @RequestMapping(value = "/emrClusters/namespaces/{namespace}/emrClusterDefinitionNames/{emrClusterDefinitionName}/emrClusterNames/{emrClusterName}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_EMR_CLUSTERS_GET) public EmrCluster getEmrCluster(@PathVariable("namespace") String namespace, @PathVariable("emrClusterDefinitionName") String emrClusterDefinitionName,
          @PathVariable("emrClusterName") String emrClusterName, @RequestParam(value = "emrClusterId", required = false) String emrClusterId,
          @RequestParam(value = "emrStepId", required = false) String emrStepId,
          @RequestParam(value = "verbose", required = false, defaultValue = "false") Boolean verbose,
          @RequestParam(value = "accountId", required = false) String accountId,
          @RequestParam(value = "retrieveInstanceFleets", required = false, defaultValue = "false") Boolean retrieveInstanceFleets)
focal_class.identifier: getEmrCluster
focal_class.modifiers: @RequestMapping(value = "/emrClusters/namespaces/{namespace}/emrClusterDefinitionNames/{emrClusterDefinitionName}/emrClusterNames/{emrClusterName}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_EMR_CLUSTERS_GET) public
focal_class.parameters: (@PathVariable("namespace") String namespace, @PathVariable("emrClusterDefinitionName") String emrClusterDefinitionName,
          @PathVariable("emrClusterName") String emrClusterName, @RequestParam(value = "emrClusterId", required = false) String emrClusterId,
          @RequestParam(value = "emrStepId", required = false) String emrStepId,
          @RequestParam(value = "verbose", required = false, defaultValue = "false") Boolean verbose,
          @RequestParam(value = "accountId", required = false) String accountId,
          @RequestParam(value = "retrieveInstanceFleets", required = false, defaultValue = "false") Boolean retrieveInstanceFleets)
focal_class.return: EmrCluster
focal_class.signature: EmrCluster getEmrCluster(@PathVariable("namespace") String namespace, @PathVariable("emrClusterDefinitionName") String emrClusterDefinitionName,
          @PathVariable("emrClusterName") String emrClusterName, @RequestParam(value = "emrClusterId", required = false) String emrClusterId,
          @RequestParam(value = "emrStepId", required = false) String emrStepId,
          @RequestParam(value = "verbose", required = false, defaultValue = "false") Boolean verbose,
          @RequestParam(value = "accountId", required = false) String accountId,
          @RequestParam(value = "retrieveInstanceFleets", required = false, defaultValue = "false") Boolean retrieveInstanceFleets)
focal_class.class_method_signature: EmrRestController.terminateEmrCluster(@PathVariable("namespace") String namespace,
          @PathVariable("emrClusterDefinitionName") String emrClusterDefinitionName, @PathVariable("emrClusterName") String emrClusterName,
          @RequestParam(value = "overrideTerminationProtection", required = false, defaultValue = "false") Boolean overrideTerminationProtection,
          @RequestParam(value = "emrClusterId", required = false) String emrClusterId, @RequestParam(value = "accountId", required = false) String accountId)
focal_class.full_signature: @RequestMapping(value = "/emrClusters/namespaces/{namespace}/emrClusterDefinitionNames/{emrClusterDefinitionName}/emrClusterNames/{emrClusterName}", method = RequestMethod.DELETE) @Secured(SecurityFunctions.FN_EMR_CLUSTERS_DELETE) public EmrCluster terminateEmrCluster(@PathVariable("namespace") String namespace,
          @PathVariable("emrClusterDefinitionName") String emrClusterDefinitionName, @PathVariable("emrClusterName") String emrClusterName,
          @RequestParam(value = "overrideTerminationProtection", required = false, defaultValue = "false") Boolean overrideTerminationProtection,
          @RequestParam(value = "emrClusterId", required = false) String emrClusterId, @RequestParam(value = "accountId", required = false) String accountId)
focal_class.identifier: terminateEmrCluster
focal_class.modifiers: @RequestMapping(value = "/emrClusters/namespaces/{namespace}/emrClusterDefinitionNames/{emrClusterDefinitionName}/emrClusterNames/{emrClusterName}", method = RequestMethod.DELETE) @Secured(SecurityFunctions.FN_EMR_CLUSTERS_DELETE) public
focal_class.parameters: (@PathVariable("namespace") String namespace,
          @PathVariable("emrClusterDefinitionName") String emrClusterDefinitionName, @PathVariable("emrClusterName") String emrClusterName,
          @RequestParam(value = "overrideTerminationProtection", required = false, defaultValue = "false") Boolean overrideTerminationProtection,
          @RequestParam(value = "emrClusterId", required = false) String emrClusterId, @RequestParam(value = "accountId", required = false) String accountId)
focal_class.return: EmrCluster
focal_class.signature: EmrCluster terminateEmrCluster(@PathVariable("namespace") String namespace,
          @PathVariable("emrClusterDefinitionName") String emrClusterDefinitionName, @PathVariable("emrClusterName") String emrClusterName,
          @RequestParam(value = "overrideTerminationProtection", required = false, defaultValue = "false") Boolean overrideTerminationProtection,
          @RequestParam(value = "emrClusterId", required = false) String emrClusterId, @RequestParam(value = "accountId", required = false) String accountId)
focal_class.superclass: extends HerdBaseController
focal_method.body: @RequestMapping(value = "/emrClusters/namespaces/{namespace}/emrClusterDefinitionNames/{emrClusterDefinitionName}/emrClusterNames/{emrClusterName}",
          method = RequestMethod.DELETE)
      @Secured(SecurityFunctions.FN_EMR_CLUSTERS_DELETE)
      public EmrCluster terminateEmrCluster(@PathVariable("namespace") String namespace,
          @PathVariable("emrClusterDefinitionName") String emrClusterDefinitionName, @PathVariable("emrClusterName") String emrClusterName,
          @RequestParam(value = "overrideTerminationProtection", required = false, defaultValue = "false") Boolean overrideTerminationProtection,
          @RequestParam(value = "emrClusterId", required = false) String emrClusterId, @RequestParam(value = "accountId", required = false) String accountId)
          throws Exception
      {
          EmrClusterAlternateKeyDto alternateKey =
              EmrClusterAlternateKeyDto.builder().withNamespace(namespace).withEmrClusterDefinitionName(emrClusterDefinitionName)
                  .withEmrClusterName(emrClusterName).build();
  
          return emrService.terminateCluster(alternateKey, overrideTerminationProtection, emrClusterId, accountId);
      }
focal_method.class_method_signature: EmrRestController.terminateEmrCluster(@PathVariable("namespace") String namespace,
          @PathVariable("emrClusterDefinitionName") String emrClusterDefinitionName, @PathVariable("emrClusterName") String emrClusterName,
          @RequestParam(value = "overrideTerminationProtection", required = false, defaultValue = "false") Boolean overrideTerminationProtection,
          @RequestParam(value = "emrClusterId", required = false) String emrClusterId, @RequestParam(value = "accountId", required = false) String accountId)
focal_method.full_signature: @RequestMapping(value = "/emrClusters/namespaces/{namespace}/emrClusterDefinitionNames/{emrClusterDefinitionName}/emrClusterNames/{emrClusterName}", method = RequestMethod.DELETE) @Secured(SecurityFunctions.FN_EMR_CLUSTERS_DELETE) public EmrCluster terminateEmrCluster(@PathVariable("namespace") String namespace,
          @PathVariable("emrClusterDefinitionName") String emrClusterDefinitionName, @PathVariable("emrClusterName") String emrClusterName,
          @RequestParam(value = "overrideTerminationProtection", required = false, defaultValue = "false") Boolean overrideTerminationProtection,
          @RequestParam(value = "emrClusterId", required = false) String emrClusterId, @RequestParam(value = "accountId", required = false) String accountId)
focal_method.identifier: terminateEmrCluster
focal_method.invocations: build withEmrClusterName withEmrClusterDefinitionName withNamespace builder terminateCluster
focal_method.modifiers: @RequestMapping(value = "/emrClusters/namespaces/{namespace}/emrClusterDefinitionNames/{emrClusterDefinitionName}/emrClusterNames/{emrClusterName}", method = RequestMethod.DELETE) @Secured(SecurityFunctions.FN_EMR_CLUSTERS_DELETE) public
focal_method.parameters: (@PathVariable("namespace") String namespace,
          @PathVariable("emrClusterDefinitionName") String emrClusterDefinitionName, @PathVariable("emrClusterName") String emrClusterName,
          @RequestParam(value = "overrideTerminationProtection", required = false, defaultValue = "false") Boolean overrideTerminationProtection,
          @RequestParam(value = "emrClusterId", required = false) String emrClusterId, @RequestParam(value = "accountId", required = false) String accountId)
focal_method.return: EmrCluster
focal_method.signature: EmrCluster terminateEmrCluster(@PathVariable("namespace") String namespace,
          @PathVariable("emrClusterDefinitionName") String emrClusterDefinitionName, @PathVariable("emrClusterName") String emrClusterName,
          @RequestParam(value = "overrideTerminationProtection", required = false, defaultValue = "false") Boolean overrideTerminationProtection,
          @RequestParam(value = "emrClusterId", required = false) String emrClusterId, @RequestParam(value = "accountId", required = false) String accountId)