@Test public void testGetAllSwitchFlows() { ResponseEntity<List<?>> responseList = new ResponseEntity<List<?>>(HttpStatus.OK); try { when(serviceSwitch.getPortFlows(TestSwitchMock.SWITCH_ID, TestSwitchMock.PORT, TestFlowMock.CONTROLLER_FLAG)).thenReturn(responseList); mockMvc.perform(get("/api/switch/{switchId}/flows", TestSwitchMock.SWITCH_ID) .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isOk()); assertTrue(true); } catch (Exception e) { assertTrue(false); } }
@RequestMapping(path = "/{switchId}/flows", method = RequestMethod.GET) @ResponseStatus(HttpStatus.OK) public @ResponseBody ResponseEntity<List<?>> getPortFlows(@PathVariable final String switchId, @RequestParam(value = "port", required = false) final String port, @RequestParam(value = "inventory", required = false) final boolean inventory) { return serviceSwitch.getPortFlows(switchId, port, inventory); }
SwitchController { @RequestMapping(path = "/{switchId}/flows", method = RequestMethod.GET) @ResponseStatus(HttpStatus.OK) public @ResponseBody ResponseEntity<List<?>> getPortFlows(@PathVariable final String switchId, @RequestParam(value = "port", required = false) final String port, @RequestParam(value = "inventory", required = false) final boolean inventory) { return serviceSwitch.getPortFlows(switchId, port, inventory); } }
SwitchController { @RequestMapping(path = "/{switchId}/flows", method = RequestMethod.GET) @ResponseStatus(HttpStatus.OK) public @ResponseBody ResponseEntity<List<?>> getPortFlows(@PathVariable final String switchId, @RequestParam(value = "port", required = false) final String port, @RequestParam(value = "inventory", required = false) final boolean inventory) { return serviceSwitch.getPortFlows(switchId, port, inventory); }  }
SwitchController { @RequestMapping(path = "/{switchId}/flows", method = RequestMethod.GET) @ResponseStatus(HttpStatus.OK) public @ResponseBody ResponseEntity<List<?>> getPortFlows(@PathVariable final String switchId, @RequestParam(value = "port", required = false) final String port, @RequestParam(value = "inventory", required = false) final boolean inventory) { return serviceSwitch.getPortFlows(switchId, port, inventory); }  @RequestMapping(value = "/list") @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.MENU_SWITCHES }) @ResponseBody List<SwitchInfo> getSwitchesDetail(
            @RequestParam(value = "storeConfigurationStatus", required = false) 
            final boolean storeConfigurationStatus,
            @RequestParam(value = "controller", required = false) 
            final boolean controller); @RequestMapping(value = "/{switchId}") @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.MENU_SWITCHES }) @ResponseBody SwitchInfo getSwitchDetail(@PathVariable final String switchId,
            @RequestParam(value = "controller", required = false) 
            final boolean controller); @RequestMapping(value = "/name/{switchId}", method = RequestMethod.PATCH) @ResponseStatus(HttpStatus.OK) @Permissions(values = {IConstants.Permission.SW_SWITCH_UPDATE_NAME}) @ResponseBody SwitchInfo saveOrUpdateSwitchName(@PathVariable final String switchId,
            @RequestBody final String switchName); @RequestMapping(value = "/links", method = RequestMethod.GET) @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.MENU_ISL }) @ResponseBody List<IslLinkInfo> getLinksDetail(@RequestParam(value = "src_switch",
            required = false) final String srcSwitch, @RequestParam(value = "src_port",
            required = false) final String srcPort, @RequestParam(value = "dst_switch",
            required = false) final String dstSwitch, @RequestParam(value = "dst_port",
            required = false) final String dstPort); @RequestMapping(value = "/links", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.ISL_DELETE_LINK }) @ResponseBody List<IslLinkInfo> deleteIsl(@RequestBody final LinkParametersDto linkParametersDto); @RequestMapping(path = "/links/under-maintenance", method = RequestMethod.PATCH) @ResponseStatus(HttpStatus.OK) @Permissions(values = {IConstants.Permission.ISL_UPDATE_MAINTENANCE}) @ResponseBody List<IslLinkInfo> updateLinkUnderMaintenance(
            @RequestBody final LinkUnderMaintenanceDto linkUnderMaintenanceDto); @RequestMapping(path = "/link/props", method = RequestMethod.GET) @ResponseStatus(HttpStatus.OK) @ResponseBody LinkProps getLinkProps(
            @RequestParam(value = "src_switch", required = true) final String srcSwitch,
            @RequestParam(value = "src_port", required = true) final String srcPort, @RequestParam(
                    value = "dst_switch", required = true) final String dstSwitch, @RequestParam(
                    value = "dst_port", required = true) final String dstPort); @RequestMapping(path = "/link/bandwidth", method = RequestMethod.PATCH) @ResponseStatus(HttpStatus.OK) @Permissions(values = {IConstants.Permission.ISL_UPDATE_BANDWIDTH}) @ResponseBody LinkMaxBandwidth updateMaxBandwidth(
            @RequestParam(value = "src_switch", required = true) final String srcSwitch,
            @RequestParam(value = "src_port", required = true) final String srcPort, @RequestParam(
                    value = "dst_switch", required = true) final String dstSwitch, @RequestParam(
                    value = "dst_port", required = true) final String dstPort, 
                    @RequestBody LinkMaxBandwidth linkMaxBandwidth); @RequestMapping(path = "/link/enable-bfd", method = RequestMethod.PATCH) @ResponseStatus(HttpStatus.OK) @Permissions(values = {IConstants.Permission.ISL_UPDATE_BFD_FLAG}) @ResponseBody List<IslLinkInfo> updateEnableBfdFlag(@RequestBody LinkParametersDto linkParametersDto); @RequestMapping(path = "/link/props", method = RequestMethod.PUT) @ResponseStatus(HttpStatus.OK) @ResponseBody String updateLinkProps(@RequestBody final List<LinkProps> keys); @RequestMapping(path = "/{switchId}/rules", method = RequestMethod.GET) @ResponseStatus(HttpStatus.OK) @Permissions(values = {IConstants.Permission.SW_PERMISSION_RULES}) @ResponseBody String getSwitchRules(@PathVariable final String switchId); @RequestMapping(path = "/{switchId}/{port}/config", method = RequestMethod.PUT) @ResponseStatus(HttpStatus.OK) @Permissions(values = {IConstants.Permission.SW_PORT_CONFIG}) @ResponseBody ConfiguredPort configureSwitchPort(
            @RequestBody final PortConfiguration configuration,
            @PathVariable final String switchId, @PathVariable final String port); @RequestMapping(path = "/{switchId}/flows", method = RequestMethod.GET) @ResponseStatus(HttpStatus.OK) @ResponseBody ResponseEntity<List<?>> getPortFlows(@PathVariable final String switchId,
            @RequestParam(value = "port", required = false) final String port, 
            @RequestParam(value = "inventory", required = false) final boolean inventory); @RequestMapping(value = "/links/flows", method = RequestMethod.GET) @ResponseStatus(HttpStatus.OK) @ResponseBody List<FlowInfo> getIslFlows(@RequestParam(name = "src_switch",
            required = true) final String srcSwitch, @RequestParam(name = "src_port",
            required = true) final String srcPort, @RequestParam(name = "dst_switch",
            required = true) final String dstSwitch, @RequestParam(name = "dst_port",
            required = true) final String dstPort); @RequestMapping(value = "/meters/{switchId}") @ResponseStatus(HttpStatus.OK) @Permissions(values = {IConstants.Permission.SW_SWITCH_METERS}) @ResponseBody SwitchMeter getSwitchMeters(@PathVariable final String switchId); @RequestMapping(value = "/under-maintenance/{switchId}", method = RequestMethod.POST) @ResponseStatus(HttpStatus.OK) @Permissions(values = {IConstants.Permission.SW_SWITCH_MAINTENANCE}) @ResponseBody SwitchInfo updateSwitchMaintenanceStatus(
            @PathVariable("switchId") final String switchId,
            @RequestBody final SwitchInfo switchInfo); @RequestMapping(value = "/{switchId}", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.SW_SWITCH_DELETE }) @ResponseBody SwitchInfo deleteSwitch(@PathVariable final String switchId,
            @RequestParam(name = "force", required = false) boolean force); @RequestMapping(value = "/{switchId}/ports/{port}/properties", method = RequestMethod.PUT) @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.SW_UPDATE_PORT_PROPERTIES }) @ResponseBody SwitchProperty updateSwitchPortProperty(@PathVariable final String switchId, 
            @PathVariable final String port, @RequestBody SwitchProperty switchProperty); @RequestMapping(value = "/{switchId}/ports/{port}/properties", method = RequestMethod.GET) @ResponseStatus(HttpStatus.OK) @ResponseBody SwitchProperty getSwitchPortProperty(@PathVariable final String switchId, 
            @PathVariable final String port); }
SwitchController { @RequestMapping(path = "/{switchId}/flows", method = RequestMethod.GET) @ResponseStatus(HttpStatus.OK) public @ResponseBody ResponseEntity<List<?>> getPortFlows(@PathVariable final String switchId, @RequestParam(value = "port", required = false) final String port, @RequestParam(value = "inventory", required = false) final boolean inventory) { return serviceSwitch.getPortFlows(switchId, port, inventory); }  @RequestMapping(value = "/list") @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.MENU_SWITCHES }) @ResponseBody List<SwitchInfo> getSwitchesDetail(
            @RequestParam(value = "storeConfigurationStatus", required = false) 
            final boolean storeConfigurationStatus,
            @RequestParam(value = "controller", required = false) 
            final boolean controller); @RequestMapping(value = "/{switchId}") @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.MENU_SWITCHES }) @ResponseBody SwitchInfo getSwitchDetail(@PathVariable final String switchId,
            @RequestParam(value = "controller", required = false) 
            final boolean controller); @RequestMapping(value = "/name/{switchId}", method = RequestMethod.PATCH) @ResponseStatus(HttpStatus.OK) @Permissions(values = {IConstants.Permission.SW_SWITCH_UPDATE_NAME}) @ResponseBody SwitchInfo saveOrUpdateSwitchName(@PathVariable final String switchId,
            @RequestBody final String switchName); @RequestMapping(value = "/links", method = RequestMethod.GET) @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.MENU_ISL }) @ResponseBody List<IslLinkInfo> getLinksDetail(@RequestParam(value = "src_switch",
            required = false) final String srcSwitch, @RequestParam(value = "src_port",
            required = false) final String srcPort, @RequestParam(value = "dst_switch",
            required = false) final String dstSwitch, @RequestParam(value = "dst_port",
            required = false) final String dstPort); @RequestMapping(value = "/links", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.ISL_DELETE_LINK }) @ResponseBody List<IslLinkInfo> deleteIsl(@RequestBody final LinkParametersDto linkParametersDto); @RequestMapping(path = "/links/under-maintenance", method = RequestMethod.PATCH) @ResponseStatus(HttpStatus.OK) @Permissions(values = {IConstants.Permission.ISL_UPDATE_MAINTENANCE}) @ResponseBody List<IslLinkInfo> updateLinkUnderMaintenance(
            @RequestBody final LinkUnderMaintenanceDto linkUnderMaintenanceDto); @RequestMapping(path = "/link/props", method = RequestMethod.GET) @ResponseStatus(HttpStatus.OK) @ResponseBody LinkProps getLinkProps(
            @RequestParam(value = "src_switch", required = true) final String srcSwitch,
            @RequestParam(value = "src_port", required = true) final String srcPort, @RequestParam(
                    value = "dst_switch", required = true) final String dstSwitch, @RequestParam(
                    value = "dst_port", required = true) final String dstPort); @RequestMapping(path = "/link/bandwidth", method = RequestMethod.PATCH) @ResponseStatus(HttpStatus.OK) @Permissions(values = {IConstants.Permission.ISL_UPDATE_BANDWIDTH}) @ResponseBody LinkMaxBandwidth updateMaxBandwidth(
            @RequestParam(value = "src_switch", required = true) final String srcSwitch,
            @RequestParam(value = "src_port", required = true) final String srcPort, @RequestParam(
                    value = "dst_switch", required = true) final String dstSwitch, @RequestParam(
                    value = "dst_port", required = true) final String dstPort, 
                    @RequestBody LinkMaxBandwidth linkMaxBandwidth); @RequestMapping(path = "/link/enable-bfd", method = RequestMethod.PATCH) @ResponseStatus(HttpStatus.OK) @Permissions(values = {IConstants.Permission.ISL_UPDATE_BFD_FLAG}) @ResponseBody List<IslLinkInfo> updateEnableBfdFlag(@RequestBody LinkParametersDto linkParametersDto); @RequestMapping(path = "/link/props", method = RequestMethod.PUT) @ResponseStatus(HttpStatus.OK) @ResponseBody String updateLinkProps(@RequestBody final List<LinkProps> keys); @RequestMapping(path = "/{switchId}/rules", method = RequestMethod.GET) @ResponseStatus(HttpStatus.OK) @Permissions(values = {IConstants.Permission.SW_PERMISSION_RULES}) @ResponseBody String getSwitchRules(@PathVariable final String switchId); @RequestMapping(path = "/{switchId}/{port}/config", method = RequestMethod.PUT) @ResponseStatus(HttpStatus.OK) @Permissions(values = {IConstants.Permission.SW_PORT_CONFIG}) @ResponseBody ConfiguredPort configureSwitchPort(
            @RequestBody final PortConfiguration configuration,
            @PathVariable final String switchId, @PathVariable final String port); @RequestMapping(path = "/{switchId}/flows", method = RequestMethod.GET) @ResponseStatus(HttpStatus.OK) @ResponseBody ResponseEntity<List<?>> getPortFlows(@PathVariable final String switchId,
            @RequestParam(value = "port", required = false) final String port, 
            @RequestParam(value = "inventory", required = false) final boolean inventory); @RequestMapping(value = "/links/flows", method = RequestMethod.GET) @ResponseStatus(HttpStatus.OK) @ResponseBody List<FlowInfo> getIslFlows(@RequestParam(name = "src_switch",
            required = true) final String srcSwitch, @RequestParam(name = "src_port",
            required = true) final String srcPort, @RequestParam(name = "dst_switch",
            required = true) final String dstSwitch, @RequestParam(name = "dst_port",
            required = true) final String dstPort); @RequestMapping(value = "/meters/{switchId}") @ResponseStatus(HttpStatus.OK) @Permissions(values = {IConstants.Permission.SW_SWITCH_METERS}) @ResponseBody SwitchMeter getSwitchMeters(@PathVariable final String switchId); @RequestMapping(value = "/under-maintenance/{switchId}", method = RequestMethod.POST) @ResponseStatus(HttpStatus.OK) @Permissions(values = {IConstants.Permission.SW_SWITCH_MAINTENANCE}) @ResponseBody SwitchInfo updateSwitchMaintenanceStatus(
            @PathVariable("switchId") final String switchId,
            @RequestBody final SwitchInfo switchInfo); @RequestMapping(value = "/{switchId}", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.SW_SWITCH_DELETE }) @ResponseBody SwitchInfo deleteSwitch(@PathVariable final String switchId,
            @RequestParam(name = "force", required = false) boolean force); @RequestMapping(value = "/{switchId}/ports/{port}/properties", method = RequestMethod.PUT) @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.SW_UPDATE_PORT_PROPERTIES }) @ResponseBody SwitchProperty updateSwitchPortProperty(@PathVariable final String switchId, 
            @PathVariable final String port, @RequestBody SwitchProperty switchProperty); @RequestMapping(value = "/{switchId}/ports/{port}/properties", method = RequestMethod.GET) @ResponseStatus(HttpStatus.OK) @ResponseBody SwitchProperty getSwitchPortProperty(@PathVariable final String switchId, 
            @PathVariable final String port);  }