EmrClusterDefinitionRestController extends HerdBaseController { @RequestMapping(value = EMR_CLUSTER_DEFINITIONS_URI_PREFIX + "/namespaces/{namespace}/emrClusterDefinitionNames/{emrClusterDefinitionName}", method = RequestMethod.DELETE) @Secured(SecurityFunctions.FN_EMR_CLUSTER_DEFINITIONS_DELETE) public EmrClusterDefinitionInformation deleteEmrClusterDefinition(@PathVariable("namespace") String namespace, @PathVariable("emrClusterDefinitionName") String emrClusterDefinitionName) throws Exception { return emrClusterDefinitionService.deleteEmrClusterDefinition(new EmrClusterDefinitionKey(namespace, emrClusterDefinitionName)); }  @RequestMapping(value = EMR_CLUSTER_DEFINITIONS_URI_PREFIX, method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_EMR_CLUSTER_DEFINITIONS_POST) EmrClusterDefinitionInformation createEmrClusterDefinition(@RequestBody EmrClusterDefinitionCreateRequest request); @RequestMapping(value = EMR_CLUSTER_DEFINITIONS_URI_PREFIX + "/namespaces/{namespace}/emrClusterDefinitionNames/{emrClusterDefinitionName}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_EMR_CLUSTER_DEFINITIONS_GET) EmrClusterDefinitionInformation getEmrClusterDefinition(@PathVariable("namespace") String namespace,
        @PathVariable("emrClusterDefinitionName") String emrClusterDefinitionName); @RequestMapping( value = EMR_CLUSTER_DEFINITIONS_URI_PREFIX + "/namespaces/{namespace}/emrClusterDefinitionNames/{emrClusterDefinitionName}", method = RequestMethod.PUT, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_EMR_CLUSTER_DEFINITIONS_PUT) EmrClusterDefinitionInformation updateEmrClusterDefinition(@PathVariable("namespace") String namespace,
        @PathVariable("emrClusterDefinitionName") String emrClusterDefinitionName, @RequestBody EmrClusterDefinitionUpdateRequest request); @RequestMapping(value = EMR_CLUSTER_DEFINITIONS_URI_PREFIX + "/namespaces/{namespace}/emrClusterDefinitionNames/{emrClusterDefinitionName}", method = RequestMethod.DELETE) @Secured(SecurityFunctions.FN_EMR_CLUSTER_DEFINITIONS_DELETE) EmrClusterDefinitionInformation deleteEmrClusterDefinition(@PathVariable("namespace") String namespace,
        @PathVariable("emrClusterDefinitionName") String emrClusterDefinitionName); @RequestMapping(value = EMR_CLUSTER_DEFINITIONS_URI_PREFIX + "/namespaces/{namespace}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_EMR_CLUSTER_DEFINITIONS_ALL_GET) EmrClusterDefinitionKeys getEmrClusterDefinitions(@PathVariable("namespace") String namespace); static final String EMR_CLUSTER_DEFINITIONS_URI_PREFIX; }
@Test public void testDeleteEmrClusterDefinition() throws Exception { EmrClusterDefinitionKey emrClusterDefinitionKey = new EmrClusterDefinitionKey(NAMESPACE, EMR_CLUSTER_DEFINITION_NAME); EmrClusterDefinition emrClusterDefinition = new EmrClusterDefinition(); EmrClusterDefinitionInformation emrClusterDefinitionInformation = new EmrClusterDefinitionInformation(ID, emrClusterDefinitionKey, emrClusterDefinition); when(emrClusterDefinitionService.deleteEmrClusterDefinition(emrClusterDefinitionKey)).thenReturn(emrClusterDefinitionInformation); EmrClusterDefinitionInformation result = emrClusterDefinitionRestController.deleteEmrClusterDefinition(NAMESPACE, EMR_CLUSTER_DEFINITION_NAME); verify(emrClusterDefinitionService).deleteEmrClusterDefinition(emrClusterDefinitionKey); verifyNoMoreInteractionsHelper(); assertEquals(emrClusterDefinitionInformation, result); }