RendererManager { public List<RendererLibrary> getRenderersForType(DisplayerType displayerType) { return renderersByType.getOrDefault(displayerType, new ArrayList<>()); } RendererManager(); @Inject  RendererManager(SyncBeanManager beanManager, Caller<RendererSettingsService> rendererSettingsService); List<RendererLibrary> getRenderers(); RendererLibrary getDefaultRenderer(DisplayerType displayerType); void setDefaultRenderer(DisplayerType displayerType, String rendererName); List<RendererLibrary> getRenderersForType(DisplayerType displayerType); List<RendererLibrary> getRenderersForType(DisplayerType type, DisplayerSubType subType); RendererLibrary getRendererByUUID(String renderer); RendererLibrary getRendererByName(String renderer); RendererLibrary getRendererForType(DisplayerType displayerType); RendererLibrary getRendererForDisplayer(DisplayerSettings target); boolean isTypeSupported(DisplayerType type);  }
@Test public void renderersForType2Test() { List<RendererLibrary> renderersForType = rendererManager.getRenderersForType(null, null); assertEquals(totalBeans, renderersForType.size()); renderersForType = rendererManager.getRenderersForType(BARCHART, null); assertEquals(2, renderersForType.size()); renderersForType = rendererManager.getRenderersForType(AREACHART, AREA); assertEquals(1, renderersForType.size()); renderersForType = rendererManager.getRenderersForType(BARCHART, BAR); assertEquals(2, renderersForType.size()); renderersForType = rendererManager.getRenderersForType(MAP, null); assertEquals(0, renderersForType.size()); renderersForType = rendererManager.getRenderersForType(MAP, MAP_REGIONS); assertEquals(0, renderersForType.size()); }
@Test public void renderersForType2SubTypesTest() { List<RendererLibrary> renderersForSubType = rendererManager.getRenderersForType(null, AREA); assertEquals(1, renderersForSubType.size()); renderersForSubType = rendererManager.getRenderersForType(null, LINE); assertEquals(2, renderersForSubType.size()); renderersForSubType = rendererManager.getRenderersForType(null, MAP_REGIONS); assertEquals(0, renderersForSubType.size()); }
@Test public void rendererForSubTypeTest() { assertEquals(2, rendererManager.getRenderersForType(BARCHART).size()); assertEquals(1, rendererManager.getRenderersForType(AREACHART).size()); }