EmrClusterDefinitionRestController extends HerdBaseController { @RequestMapping(value = EMR_CLUSTER_DEFINITIONS_URI_PREFIX + "/namespaces/{namespace}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_EMR_CLUSTER_DEFINITIONS_ALL_GET) public EmrClusterDefinitionKeys getEmrClusterDefinitions(@PathVariable("namespace") String namespace) throws Exception { return emrClusterDefinitionService.getEmrClusterDefinitions(namespace); }  @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 testGetEmrClusterDefinitions() throws Exception { EmrClusterDefinitionKeys emrClusterDefinitionKeys = new EmrClusterDefinitionKeys(Arrays.asList(new EmrClusterDefinitionKey(NAMESPACE, EMR_CLUSTER_DEFINITION_NAME))); when(emrClusterDefinitionService.getEmrClusterDefinitions(NAMESPACE)).thenReturn(emrClusterDefinitionKeys); EmrClusterDefinitionKeys result = emrClusterDefinitionRestController.getEmrClusterDefinitions(NAMESPACE); verify(emrClusterDefinitionService).getEmrClusterDefinitions(NAMESPACE); verifyNoMoreInteractionsHelper(); assertEquals(emrClusterDefinitionKeys, result); }