EmrRestController extends HerdBaseController { @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) throws Exception { return (EmrHadoopJarStep) emrService.addStepToCluster(request); }  @RequestMapping(value = "/emrHadoopJarSteps", method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_EMR_HADOOP_JAR_STEPS_POST) EmrHadoopJarStep addHadoopJarStepToEmrCluster(@RequestBody EmrHadoopJarStepAddRequest request); @RequestMapping(value = "/emrHiveSteps", method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_EMR_HIVE_STEPS_POST) EmrHiveStep addHiveStepToEmrCluster(@RequestBody EmrHiveStepAddRequest request); @RequestMapping(value = "/emrPigSteps", method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_EMR_PIG_STEPS_POST) EmrPigStep addPigStepToEmrCluster(@RequestBody EmrPigStepAddRequest request); @RequestMapping(value = "/emrShellSteps", method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_EMR_SHELL_STEPS_POST) EmrShellStep addShellStepToEmrCluster(@RequestBody EmrShellStepAddRequest request); @RequestMapping(value = "/emrClusters", method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_EMR_CLUSTERS_POST) EmrCluster createEmrCluster(@RequestBody EmrClusterCreateRequest request); @RequestMapping(value = "/emrClusters/namespaces/{namespace}/emrClusterDefinitionNames/{emrClusterDefinitionName}/emrClusterNames/{emrClusterName}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_EMR_CLUSTERS_GET) 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); @RequestMapping(value = "/emrClusters/namespaces/{namespace}/emrClusterDefinitionNames/{emrClusterDefinitionName}/emrClusterNames/{emrClusterName}", method = RequestMethod.DELETE) @Secured(SecurityFunctions.FN_EMR_CLUSTERS_DELETE) 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);  }
@Test public void testAddHadoopJarStepToEmrCluster() throws Exception { EmrHadoopJarStepAddRequest emrHadoopJarStepAddRequest = new EmrHadoopJarStepAddRequest(NAMESPACE, EMR_CLUSTER_DEFINITION_NAME, EMR_CLUSTER_NAME, EMR_STEP_NAME, EMR_STEP_JAR_LOCATION, EMR_STEP_MAIN_CLASS, Arrays.asList(ATTRIBUTE_NAME_1_MIXED_CASE), CONTINUE_ON_ERROR, EMR_CLUSTER_ID, AWS_ACCOUNT_ID); EmrHadoopJarStep emrHadoopJarStep = new EmrHadoopJarStep(EMR_STEP_ID, NAMESPACE, EMR_CLUSTER_DEFINITION_NAME, EMR_CLUSTER_NAME, EMR_STEP_NAME, EMR_STEP_JAR_LOCATION, EMR_STEP_MAIN_CLASS, Arrays.asList(ATTRIBUTE_NAME_1_MIXED_CASE), CONTINUE_ON_ERROR, EMR_CLUSTER_ID); when(emrService.addStepToCluster(emrHadoopJarStepAddRequest)).thenReturn(emrHadoopJarStep); EmrHadoopJarStep result = emrRestController.addHadoopJarStepToEmrCluster(emrHadoopJarStepAddRequest); verify(emrService).addStepToCluster(emrHadoopJarStepAddRequest); verifyNoMoreInteractionsHelper(); assertEquals(emrHadoopJarStep, result); }