private List<Pair<ProviderType, ProviderTypeStatus>> buildProviderStatusList(final Map<ProviderType, ProviderTypeStatus> statusMap) { return statusMap.entrySet() .stream() .filter(entry -> handlerRegistry.isProviderInstalled(entry.getKey().getKey())) .map(entry -> new Pair<>(entry.getKey(), entry.getValue())) .sorted(Comparator.comparing(o -> o.getK1().getName())) .collect(Collectors.toList()); } }
private List<Pair<ProviderType, ProviderTypeStatus>> buildProviderStatusList(final Map<ProviderType, ProviderTypeStatus> statusMap) { return statusMap.entrySet() .stream() .filter(entry -> handlerRegistry.isProviderInstalled(entry.getKey().getKey())) .map(entry -> new Pair<>(entry.getKey(), entry.getValue())) .sorted(Comparator.comparing(o -> o.getK1().getName())) .collect(Collectors.toList()); } }
/** * Helper method for showing whe provider type name in a consistent way around the different widgets. * @param providerType a provider type. * @return Returns a String with the provider name to show in the UI. */ public static String getDisplayableProviderTypeName(ProviderType providerType) { return providerType.getName() + " " + providerType.getKey().getVersion(); }
/** * Helper method for showing whe provider type name in a consistent way around the different widgets. * @param providerType a provider type. * @return Returns a String with the provider name to show in the UI. */ public static String getDisplayableProviderTypeName(ProviderType providerType) { return providerType.getName() + " " + providerType.getKey().getVersion(); }
public void start(final ProviderType providerType) { this.providerType = providerType; this.providerConfigurationForm = getProviderConfigurationForm(providerType.getKey()); if (providerConfigurationForm != null) { providerConfigurationPage.setProviderConfigurationForm(providerConfigurationForm); clear(); super.start(); } else { //uncommon case, will next never occur. popupHelper.showErrorPopup(translationService.format( NewProviderWizard_ProviderNotProperlyConfiguredInSystemErrorMessage, (providerType != null ? providerType.getName() : null))); } }
@Before public void setUp() { when(popupHelper.getPopupErrorCallback()).thenReturn(defaultErrorCallback); providerServiceCaller = spy(new CallerMock<>(providerService)); wizard = new NewProviderWizard(configurationPage, handlerRegistry, popupHelper, translationService, providerServiceCaller, notification, providerTypeSelectedEvent) { { this.view = wizardView; } }; wizard.init(); providerType = mockProviderType("NewProviderWizardTest"); when(handlerRegistry.isProviderInstalled(providerType.getKey())).thenReturn(true); when(handlerRegistry.getProviderHandler(providerType.getKey())).thenReturn(providerHandler); when(providerHandler.getFormResolver()).thenReturn(formResolver); when(formResolver.newProviderConfigurationForm()).thenReturn(configurationForm); when(translationService.format(NewProviderWizard_ProviderNotProperlyConfiguredInSystemErrorMessage, providerType.getName())) .thenReturn(ERROR_MESSAGE); when(translationService.getTranslation(NewProviderWizard_ProviderCreateSuccessMessage)).thenReturn(SUCCESS_MESSAGE); }
public void start(final ProviderType providerType) { this.providerType = providerType; this.providerConfigurationForm = getProviderConfigurationForm(providerType.getKey()); if (providerConfigurationForm != null) { providerConfigurationPage.setProviderConfigurationForm(providerConfigurationForm); clear(); super.start(); } else { //uncommon case, will next never occur. popupHelper.showErrorPopup(translationService.format( NewProviderWizard_ProviderNotProperlyConfiguredInSystemErrorMessage, (providerType != null ? providerType.getName() : null))); } }
@Before public void setUp() { when(popupHelper.getPopupErrorCallback()).thenReturn(defaultErrorCallback); providerServiceCaller = spy(new CallerMock<>(providerService)); wizard = new NewProviderWizard(configurationPage, handlerRegistry, popupHelper, translationService, providerServiceCaller, notification, providerTypeSelectedEvent) { { this.view = wizardView; } }; wizard.init(); providerType = mockProviderType("NewProviderWizardTest"); when(handlerRegistry.isProviderInstalled(providerType.getKey())).thenReturn(true); when(handlerRegistry.getProviderHandler(providerType.getKey())).thenReturn(providerHandler); when(providerHandler.getFormResolver()).thenReturn(formResolver); when(formResolver.newProviderConfigurationForm()).thenReturn(configurationForm); when(translationService.format(NewProviderWizard_ProviderNotProperlyConfiguredInSystemErrorMessage, providerType.getName())) .thenReturn(ERROR_MESSAGE); when(translationService.getTranslation(NewProviderWizard_ProviderCreateSuccessMessage)).thenReturn(SUCCESS_MESSAGE); }