@Test void testGetForwardPluginUriUnknownPlugin() { String pluginId = "pluginA"; when(dataService.findOneById(PLUGIN, pluginId, Plugin.class)).thenReturn(null); Exception exception = assertThrows( UnknownPluginException.class, () -> molgenisMenuController.getForwardPluginUri(pluginId, null, null)); assertThat(exception.getMessage()).containsPattern("id:pluginA"); }
private String getForwardPluginUri(String pluginId) { return getForwardPluginUri(pluginId, null); }
MolgenisMenuController { private String getForwardPluginUri(String pluginId) { return getForwardPluginUri(pluginId, null); } }
MolgenisMenuController { private String getForwardPluginUri(String pluginId) { return getForwardPluginUri(pluginId, null); } MolgenisMenuController(
      MenuReaderService menuReaderService,
      @Value("${molgenis.version}") String molgenisVersion,
      @Value("${molgenis.build.date}") String molgenisBuildData,
      DataService dataService); }
MolgenisMenuController { private String getForwardPluginUri(String pluginId) { return getForwardPluginUri(pluginId, null); } MolgenisMenuController(
      MenuReaderService menuReaderService,
      @Value("${molgenis.version}") String molgenisVersion,
      @Value("${molgenis.build.date}") String molgenisBuildData,
      DataService dataService); @Transactional(readOnly = true) @SuppressWarnings("java:S3752") // multiple methods required @RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}) String forwardDefaultMenuDefaultPlugin(Model model); @SuppressWarnings("java:S3752") // multiple methods required @RequestMapping( method = {RequestMethod.GET, RequestMethod.POST}, value = "/{menuId}") String forwardMenuDefaultPlugin(@Valid @NotNull @PathVariable String menuId, Model model); @SuppressWarnings("java:S3752") // multiple methods required @RequestMapping("/{menuId}/{pluginId}/**") String forwardMenuPlugin(
      HttpServletRequest request,
      @Valid @NotNull @PathVariable String menuId,
      @Valid @NotNull @PathVariable String pluginId,
      Model model); }
MolgenisMenuController { private String getForwardPluginUri(String pluginId) { return getForwardPluginUri(pluginId, null); } MolgenisMenuController(
      MenuReaderService menuReaderService,
      @Value("${molgenis.version}") String molgenisVersion,
      @Value("${molgenis.build.date}") String molgenisBuildData,
      DataService dataService); @Transactional(readOnly = true) @SuppressWarnings("java:S3752") // multiple methods required @RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}) String forwardDefaultMenuDefaultPlugin(Model model); @SuppressWarnings("java:S3752") // multiple methods required @RequestMapping( method = {RequestMethod.GET, RequestMethod.POST}, value = "/{menuId}") String forwardMenuDefaultPlugin(@Valid @NotNull @PathVariable String menuId, Model model); @SuppressWarnings("java:S3752") // multiple methods required @RequestMapping("/{menuId}/{pluginId}/**") String forwardMenuPlugin(
      HttpServletRequest request,
      @Valid @NotNull @PathVariable String menuId,
      @Valid @NotNull @PathVariable String pluginId,
      Model model); static final String URI; }