From 9097514bbf2f92b8f280cc4df0854a70bbdf0207 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Petrovick=C3=BD?= Date: Sat, 26 Jan 2019 13:34:02 +0100 Subject: [PATCH] Switch from logging through SLF4J to Log4J v2.x (#376) The API is better, as it allows truly async calls. Also, SLF4J appears to be dead with months of no activity in the project. --- pom.xml | 46 ++--- robozonky-api/pom.xml | 10 +- robozonky-api/revapi.json | 175 ++++++++++++++++++ .../api/remote/entities/BaseEntity.java | 12 +- .../sanitized/AbstractMutableLoanImpl.java | 10 +- .../sanitized/MutableInvestmentImpl.java | 8 +- .../api/strategies/LoanDescriptor.java | 8 +- .../robozonky/internal/api/Settings.java | 8 +- .../robozonky/internal/util/DateUtil.java | 8 +- .../robozonky/internal/util/RandomUtil.java | 8 +- .../internal/util/ToStringBuilder.java | 4 +- .../api/notifications/EventTest.java | 4 +- .../remote/entities/ZonkyApiTokenTest.java | 4 +- .../entities/sanitized/DevelopmentTest.java | 7 +- .../entities/sanitized/InvestmentTest.java | 7 +- .../remote/entities/sanitized/LoanTest.java | 6 +- .../sanitized/MarketplaceLoanTest.java | 4 +- .../remote/entities/sanitized/UtilTest.java | 8 +- .../api/remote/enums/BaseEnumTest.java | 5 +- .../api/remote/enums/DevelopmentTypeTest.java | 5 +- .../api/remote/enums/PaymentStatusTest.java | 4 +- .../api/remote/enums/RegionTest.java | 4 +- .../strategies/InvestmentDescriptorTest.java | 4 +- .../api/strategies/LoanDescriptorTest.java | 4 +- .../ParticipationDescriptorTest.java | 7 +- .../strategies/RecommendedInvestmentTest.java | 4 +- .../RecommendedParticipationTest.java | 7 +- .../util/AbstractMinimalRoboZonkyTest.java | 8 +- .../util/BigDecimalCalculatorTest.java | 4 +- .../robozonky/internal/util/MapsTest.java | 4 +- .../internal/util/ToStringBuilderTest.java | 8 +- robozonky-app/pom.xml | 10 +- .../java/com/github/robozonky/app/App.java | 8 +- .../app/RoboZonkyStartupNotifier.java | 8 +- .../github/robozonky/app/ShutdownHook.java | 34 ++-- .../app/configuration/CommandLine.java | 8 +- .../app/configuration/OperatingMode.java | 8 +- .../configuration/SecretProviderFactory.java | 10 +- .../app/daemon/DaemonInvestmentMode.java | 8 +- .../app/daemon/InvestingSession.java | 12 +- .../github/robozonky/app/daemon/Investor.java | 8 +- .../daemon/PurchasingOperationDescriptor.java | 8 +- .../app/daemon/PurchasingSession.java | 8 +- .../github/robozonky/app/daemon/Selling.java | 8 +- .../robozonky/app/daemon/SessionState.java | 14 +- .../robozonky/app/daemon/Skippable.java | 11 +- .../app/daemon/StrategyExecutor.java | 8 +- .../robozonky/app/delinquencies/Category.java | 8 +- .../DelinquencyNotificationPayload.java | 8 +- .../app/events/EventFiringQueue.java | 8 +- .../app/events/EventFiringRunnable.java | 8 +- .../robozonky/app/events/GlobalEvents.java | 8 +- .../events/LoggingEventFiringListener.java | 8 +- .../robozonky/app/events/SessionEvents.java | 8 +- .../app/events/impl/AbstractEventImpl.java | 10 +- .../app/events/impl/LazyEventImpl.java | 8 +- .../app/runtime/DaemonShutdownHook.java | 8 +- .../robozonky/app/runtime/Lifecycle.java | 8 +- .../robozonky/app/runtime/LivenessCheck.java | 8 +- .../robozonky/app/runtime/MainControl.java | 8 +- .../app/runtime/ShutdownEnabler.java | 8 +- .../robozonky/app/tenant/DelayedFiring.java | 8 +- .../robozonky/app/tenant/LoanCache.java | 8 +- .../robozonky/app/tenant/PowerTenantImpl.java | 8 +- .../robozonky/app/tenant/RemoteData.java | 8 +- .../app/tenant/RemotePortfolioImpl.java | 8 +- .../app/tenant/SoldParticipationCache.java | 8 +- .../app/tenant/StrategyProvider.java | 8 +- .../tenant/TransactionalInstanceState.java | 8 +- .../tenant/TransactionalPowerTenantImpl.java | 8 +- .../com/github/robozonky/app/tenant/Util.java | 8 +- .../app/tenant/ZonkyApiTokenSupplier.java | 8 +- .../transactions/TransactionProcessor.java | 8 +- .../robozonky/app/version/UpdateMonitor.java | 4 +- .../app/version/UpdateNotification.java | 14 +- .../app/AbstractEventLeveragingTest.java | 4 +- .../com/github/robozonky/app/AppTest.java | 8 +- .../github/robozonky/app/ReturnCodeTest.java | 4 +- .../app/RobozonkyStartupNotifierTest.java | 4 +- .../robozonky/app/ShutdownHookTest.java | 11 +- .../app/configuration/CommandLineTest.java | 9 +- .../app/configuration/OperatingModeTest.java | 7 +- .../SecretProviderFactoryTest.java | 8 +- .../app/daemon/InvestingSessionTest.java | 11 +- .../robozonky/app/daemon/InvestorTest.java | 9 +- .../app/daemon/PurchasingSessionTest.java | 10 +- .../robozonky/app/daemon/SellingJobTest.java | 4 +- .../robozonky/app/daemon/SellingTest.java | 12 +- .../app/daemon/SessionStateTest.java | 4 +- .../robozonky/app/daemon/SkippableTest.java | 10 +- .../app/daemon/StaticInvestorTest.java | 4 +- .../app/delinquencies/CategoryTest.java | 7 +- .../DelinquencyNotificationJobTest.java | 4 +- .../DelinquencyNotificationPayloadTest.java | 6 +- .../app/delinquencies/RegistryTest.java | 6 +- .../app/delinquencies/StorageTest.java | 4 +- .../app/events/EventFiringQueueTest.java | 6 +- .../app/events/EventFiringRunnableTest.java | 9 +- .../app/events/GlobalEventsTest.java | 6 +- .../app/events/SessionEventsImplTest.java | 9 +- .../app/events/impl/EventFactoryTest.java | 7 +- .../robozonky/app/runtime/AboutMBeanTest.java | 6 +- .../app/runtime/DaemonShutdownHookTest.java | 5 +- .../robozonky/app/runtime/LifecycleTest.java | 9 +- .../app/runtime/LivenessCheckTest.java | 4 +- .../app/runtime/ShutdownEnablerTest.java | 5 +- .../robozonky/app/tenant/BlockedTest.java | 4 +- .../app/tenant/DelayedFiringTest.java | 7 +- .../robozonky/app/tenant/DivisorTest.java | 4 +- .../app/tenant/PortfolioOverviewImplTest.java | 4 +- .../robozonky/app/tenant/PowerTenantTest.java | 6 +- .../robozonky/app/tenant/RemoteDataTest.java | 4 +- .../app/tenant/StrategyProviderTest.java | 4 +- .../TransactionalInstanceStateTest.java | 9 +- .../github/robozonky/app/tenant/UtilTest.java | 9 +- .../app/transactions/IncomeProcessorTest.java | 8 +- .../transactions/LoanRepaidProcessorTest.java | 8 +- .../ParticipationSoldProcessorTest.java | 6 +- .../TransactionProcessingJobTest.java | 4 +- .../app/version/UpdateMonitorTest.java | 9 +- .../app/version/UpdateNotificationTest.java | 8 +- robozonky-cli/pom.xml | 18 +- .../github/robozonky/cli/AbstractFeature.java | 22 +-- .../com/github/robozonky/cli/Checker.java | 22 +-- .../cli/GoogleCredentialsFeature.java | 12 +- .../cli/NotificationTestingFeature.java | 4 +- .../cli/StrategyValidationFeature.java | 4 +- .../robozonky/cli/AbstractFeatureTest.java | 4 +- .../com/github/robozonky/cli/CheckerTest.java | 4 +- .../com/github/robozonky/cli/CliTest.java | 4 +- .../cli/GoogleCredentialsFeatureTest.java | 5 +- .../cli/LogbackConfiguratorTest.java | 8 +- .../cli/MasterPasswordFeatureTest.java | 5 +- .../cli/NotificationTestingFeatureTest.java | 4 +- .../cli/StrategyValidationFeatureTest.java | 5 +- .../cli/TestingZonkoidProviderService.java | 4 +- .../cli/ZonkoidPasswordFeatureTest.java | 8 +- .../cli/ZonkyPasswordFeatureTest.java | 11 +- robozonky-common/pom.xml | 17 +- .../common/async/AbstractReloadableImpl.java | 8 +- .../robozonky/common/async/Backoff.java | 8 +- .../robozonky/common/async/ManualReload.java | 8 +- .../robozonky/common/async/Refreshable.java | 26 +-- .../common/async/ReloadableBuilder.java | 8 +- .../robozonky/common/async/Scheduler.java | 8 +- .../common/async/TimeBasedReload.java | 8 +- .../ConfirmationProviderLoader.java | 15 +- .../common/extensions/ExtensionsManager.java | 16 +- .../robozonky/common/extensions/FileUtil.java | 12 +- .../common/extensions/JobServiceLoader.java | 19 +- .../extensions/ListenerServiceLoader.java | 8 +- .../common/extensions/StrategyLoader.java | 24 +-- .../common/management/AbstractBaseMBean.java | 8 +- .../common/management/Management.java | 8 +- .../github/robozonky/common/remote/Api.java | 8 +- .../robozonky/common/remote/ApiProvider.java | 8 +- .../common/remote/BlockingOperation.java | 8 +- .../remote/EntityCollectionPageSource.java | 8 +- .../robozonky/common/remote/PaginatedApi.java | 8 +- .../robozonky/common/remote/ProxyFactory.java | 8 +- .../common/remote/RoboZonkyFilter.java | 8 +- .../github/robozonky/common/remote/Zonky.java | 8 +- .../robozonky/common/secrets/Credentials.java | 12 +- .../common/secrets/KeyStoreHandler.java | 24 +-- .../secrets/KeyStoreSecretProvider.java | 31 ++-- .../common/state/FileBackedStateStorage.java | 8 +- .../robozonky/common/state/StateCleaner.java | 8 +- .../robozonky/common/state/TenantState.java | 8 +- .../robozonky/common/async/BackoffTest.java | 8 +- .../common/async/RefreshableTest.java | 9 +- .../common/async/ReloadableBuilderTest.java | 6 +- .../common/async/ReloadableImplTest.java | 7 +- .../async/RoboZonkyThreadFactoryTest.java | 4 +- .../common/async/SchedulerServiceTest.java | 6 +- .../extensions/ExtensionsManagerTest.java | 4 +- .../common/extensions/FileUtilTest.java | 8 +- .../extensions/JobServiceLoaderTest.java | 4 +- .../extensions/ListenerServiceLoaderTest.java | 8 +- .../common/extensions/StrategyLoaderTest.java | 4 +- .../management/AbstractBaseMBeanTest.java | 4 +- .../common/management/ManagementTest.java | 4 +- .../management/RoboZonkyQueryExpTest.java | 6 +- .../common/remote/ApiProviderTest.java | 9 +- .../robozonky/common/remote/ApiTest.java | 9 +- .../EntityCollectionPageSourceTest.java | 8 +- .../remote/InterceptingInputStreamTest.java | 4 +- .../common/remote/PaginatedApiImplTest.java | 12 +- .../common/remote/ProxyFactoryTest.java | 4 +- .../common/remote/RoboZonkyFilterTest.java | 10 +- .../robozonky/common/remote/SelectTest.java | 7 +- .../robozonky/common/remote/ZonkyTest.java | 13 +- .../common/secrets/CredentialsTest.java | 4 +- .../secrets/FallbackSecretProviderTest.java | 4 +- .../common/secrets/KeyStoreHandlerTest.java | 6 +- .../state/FileBackedStateStorageTest.java | 10 +- .../common/state/InstanceStateImplTest.java | 4 +- .../state/StateCleanerJobServiceTest.java | 4 +- .../common/state/TenantStateTest.java | 4 +- .../github/robozonky/util/StreamUtilTest.java | 6 +- robozonky-installer/pom.xml | 14 +- .../AbstractEmailServerValidator.java | 6 +- .../installer/AbstractValidator.java | 14 +- .../installer/EmailSettingsValidator.java | 4 +- .../installer/RoboZonkyInstallerListener.java | 8 +- .../installer/StrategySettingsValidator.java | 4 +- .../com/github/robozonky/installer/Util.java | 8 +- .../installer/ZonkySettingsValidator.java | 6 +- .../installer/scripts/RunScriptGenerator.java | 8 +- .../installer/AbstractValidatorTest.java | 4 +- .../AdvancedEmailServerValidatorTest.java | 14 +- .../installer/CommandLinePartTest.java | 4 +- .../installer/EmailSettingsValidatorTest.java | 14 +- .../RoboZonkyInstallerListenerTest.java | 11 +- .../SimpleEmailServerValidatorTest.java | 15 +- .../StrategySettingsValidatorTest.java | 8 +- .../github/robozonky/installer/UtilTest.java | 4 +- .../robozonky/installer/VariablesTest.java | 8 +- .../ZonkoidSettingsValidatorTest.java | 4 +- .../installer/ZonkySettingsValidatorTest.java | 11 +- .../scripts/RunScriptGeneratorTest.java | 4 +- robozonky-integration-stonky/pom.xml | 6 +- .../robozonky/integrations/stonky/ApiKey.java | 8 +- .../integrations/stonky/DriveOverview.java | 8 +- .../robozonky/integrations/stonky/Export.java | 8 +- .../stonky/GoogleCredentialProvider.java | 8 +- .../robozonky/integrations/stonky/Stonky.java | 8 +- .../robozonky/integrations/stonky/Util.java | 8 +- .../integrations/stonky/ApiKeyTest.java | 4 +- .../stonky/DriveOverviewTest.java | 4 +- .../integrations/stonky/ExportTest.java | 10 +- .../stonky/GoogleCredentialProviderTest.java | 5 +- .../stonky/InternalSheetTest.java | 4 +- .../integrations/stonky/ResponseHandler.java | 12 +- .../stonky/StonkyJobServiceTest.java | 4 +- .../integrations/stonky/StonkyJobTest.java | 7 +- .../integrations/stonky/StonkyTest.java | 9 +- .../integrations/stonky/UtilTest.java | 4 +- robozonky-integration-zonkoid/pom.xml | 15 +- .../robozonky/integrations/zonkoid/Util.java | 8 +- .../zonkoid/ZonkoidConfirmationProvider.java | 8 +- .../ZonkoidConfirmationProviderTest.java | 5 +- robozonky-notifications/pom.xml | 11 +- .../notifications/AbstractTargetHandler.java | 8 +- .../robozonky/notifications/Counter.java | 8 +- .../robozonky/notifications/EmailHandler.java | 8 +- .../NotificationEventListenerSupplier.java | 8 +- .../NotificationListenerService.java | 8 +- .../RefreshableConfigStorage.java | 8 +- .../listeners/AbstractListener.java | 16 +- .../BalanceOnTargetEventListener.java | 4 +- .../BalanceUnderMinimumEventListener.java | 4 +- .../listeners/FinancialCalculator.java | 8 +- .../notifications/ConfigStorageTest.java | 4 +- .../robozonky/notifications/CounterTest.java | 5 +- .../notifications/EmailHandlerTest.java | 10 +- ...NotificationEventListenerSupplierTest.java | 6 +- .../NotificationListenerServiceTest.java | 4 +- .../RefreshableConfigStorageTest.java | 4 +- .../notifications/SupportedListenerTest.java | 4 +- .../listeners/AbstractListenerTest.java | 10 +- .../BalanceOnTargetEventListenerTest.java | 8 +- .../listeners/BalanceTrackerTest.java | 4 +- .../BalanceUnderMinimumEventListenerTest.java | 8 +- .../listeners/DelinquencyTrackerTest.java | 8 +- .../listeners/FinancialCalculatorTest.java | 4 +- .../listeners/FinancialUtilTest.java | 4 +- ...oboZonkyDaemonFailedEventListenerTest.java | 4 +- .../notifications/listeners/UtilTest.java | 4 +- .../InterestNumberFormatFactoryTest.java | 4 +- robozonky-strategy-natural/pom.xml | 11 +- .../natural/NaturalLanguageStrategy.g4 | 6 +- .../main/antlr4/imports/MarketplaceFilters.g4 | 4 +- .../robozonky/strategy/natural/Decisions.java | 8 +- .../strategy/natural/FilterSupplier.java | 8 +- .../NaturalLanguageStrategyService.java | 8 +- .../strategy/natural/ParsedStrategy.java | 8 +- .../strategy/natural/DecisionsTest.java | 7 +- .../natural/DefaultInvestmentShareTest.java | 5 +- .../strategy/natural/DefaultValuesTest.java | 5 +- .../strategy/natural/ExitPropertiesTest.java | 4 +- .../strategy/natural/FilterSupplierTest.java | 4 +- .../GeneratedStrategyVerifierTest.java | 4 +- .../InvestmentSizeRecommenderTest.java | 8 +- .../strategy/natural/InvestmentSizeTest.java | 4 +- ...NaturalLanguageInvestmentStrategyTest.java | 8 +- .../NaturalLanguagePurchaseStrategyTest.java | 9 +- .../NaturalLanguageSellStrategyTest.java | 9 +- .../strategy/natural/ParsedStrategyTest.java | 9 +- .../strategy/natural/PortfolioShareTest.java | 4 +- .../natural/RoboZonkyVersionTest.java | 4 +- .../SecondaryMarketplaceComparatorTest.java | 5 +- .../robozonky/strategy/natural/UtilTest.java | 7 +- .../AbstractEnumeratedConditionTest.java | 4 +- .../AlwaysAcceptingConditionTest.java | 4 +- .../conditions/AverageStoryConditionTest.java | 7 +- .../ElapsedLoanTermConditionTest.java | 7 +- .../conditions/ExitPropertiesTest.java | 4 +- .../conditions/InsuranceConditionTest.java | 4 +- .../conditions/LoanAmountConditionTest.java | 7 +- .../conditions/LoanTermConditionTest.java | 7 +- .../conditions/LongStoryConditionTest.java | 7 +- .../MarketplaceFilterConditionImplTest.java | 4 +- .../conditions/NegatingConditionTest.java | 4 +- .../NeverAcceptingConditionTest.java | 4 +- .../conditions/ParticipationWrapperTest.java | 5 +- .../RelativeElapsedLoanTermConditionTest.java | 7 +- .../RelativeLoanTermConditionTest.java | 7 +- .../RemainingAmountConditionTest.java | 7 +- .../conditions/ShortStoryConditionTest.java | 7 +- .../VeryShortStoryConditionTest.java | 7 +- robozonky-test/pom.xml | 10 +- .../robozonky/test/AbstractRoboZonkyTest.java | 10 +- .../test/RoboZonkyTestExecutionListener.java | 8 +- .../robozonky/test/SystemProperties.java | 8 +- .../TestingScheduledExecutorService.java | 8 +- 315 files changed, 1303 insertions(+), 1315 deletions(-) diff --git a/pom.xml b/pom.xml index 7c48d29d1..f5201b040 100644 --- a/pom.xml +++ b/pom.xml @@ -1,6 +1,6 @@ 1.6.2 - commons-logging - commons-logging - - org.apache.httpcomponents httpcore 4.4.10 - - - commons-logging - commons-logging - - @@ -382,16 +370,22 @@ jackson-coreutils 1.8 - + - org.slf4j - slf4j-api - ${version.org.slf4j} + org.apache.logging.log4j + log4j-api + ${version.org.apache.logging.log4j} - - org.slf4j - jcl-over-slf4j - ${version.org.slf4j} + + org.apache.logging.log4j + log4j-to-slf4j + ${version.org.apache.logging.log4j} + + + org.apache.logging.log4j + log4j-jcl + ${version.org.apache.logging.log4j} + test ch.qos.logback @@ -444,11 +438,6 @@ - - - commons-logging - - true @@ -546,7 +535,7 @@ com.github.robozonky com.sun.mail ch.qos.logback - org.slf4j + org.apache.logging.log4j org.jboss.resteasy org.jboss.spec.javax.xml.bind org.jboss.spec.javay.ws.rs @@ -554,6 +543,7 @@ ch.qos.logback + org.slf4j diff --git a/robozonky-api/pom.xml b/robozonky-api/pom.xml index 87fca0c51..6383f1049 100644 --- a/robozonky-api/pom.xml +++ b/robozonky-api/pom.xml @@ -1,6 +1,6 @@ diff --git a/robozonky-cli/src/main/java/com/github/robozonky/cli/AbstractFeature.java b/robozonky-cli/src/main/java/com/github/robozonky/cli/AbstractFeature.java index cc2403678..9d100b211 100644 --- a/robozonky-cli/src/main/java/com/github/robozonky/cli/AbstractFeature.java +++ b/robozonky-cli/src/main/java/com/github/robozonky/cli/AbstractFeature.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,32 +18,32 @@ import java.io.IOException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; abstract class AbstractFeature implements Feature { - protected final Logger LOGGER = LoggerFactory.getLogger(this.getClass()); + protected final Logger logger = LogManager.getLogger(this.getClass()); @Override public ExitCode call() { - LOGGER.info("Welcome to the RoboZonky command-line configuration and validation tool."); - LOGGER.warn("This is a tool for the brave. Create a backup copy of RoboZonky " + + logger.info("Welcome to the RoboZonky command-line configuration and validation tool."); + logger.warn("This is a tool for the brave. Create a backup copy of RoboZonky " + "or use RoboZonky installer instead."); try { final String description = describe(); - LOGGER.info("--- Press any key to run: '{}'", description); + logger.info("--- Press any key to run: '{}'", description); System.in.read(); setup(); - LOGGER.info("--- Executed, running test of the new setup."); + logger.info("--- Executed, running test of the new setup."); test(); - LOGGER.info("--- Success."); + logger.info("--- Success."); return ExitCode.SUCCESS; } catch (final SetupFailedException | IOException e) { - LOGGER.error("!!! Could not perform setup, configuration may have been corrupted.", e); + logger.error("Could not perform setup, configuration may have been corrupted.", e); return ExitCode.SETUP_FAIL; } catch (final TestFailedException e) { - LOGGER.error("!!! Could not test setup, configuration may have been corrupted.", e); + logger.error("Could not test setup, configuration may have been corrupted.", e); return ExitCode.TEST_FAIL; } } diff --git a/robozonky-cli/src/main/java/com/github/robozonky/cli/Checker.java b/robozonky-cli/src/main/java/com/github/robozonky/cli/Checker.java index 2c151a72d..96b9c5ea8 100644 --- a/robozonky-cli/src/main/java/com/github/robozonky/cli/Checker.java +++ b/robozonky-cli/src/main/java/com/github/robozonky/cli/Checker.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,16 +35,16 @@ import com.github.robozonky.common.extensions.ListenerServiceLoader; import com.github.robozonky.common.remote.ApiProvider; import com.github.robozonky.internal.util.DateUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; public final class Checker { - private static final Logger LOGGER = LoggerFactory.getLogger(Checker.class); + private static final Logger LOGGER = LogManager.getLogger(Checker.class); private static final Comparator SUBCOMPARATOR = Comparator.comparing(RawLoan::getRemainingInvestment).reversed(); private static final Comparator COMPARATOR = - Comparator.comparing(RawLoan::getInterestRate).thenComparing(Checker.SUBCOMPARATOR); + Comparator.comparing(RawLoan::getInterestRate).thenComparing(SUBCOMPARATOR); private Checker() { // no instances @@ -58,9 +58,9 @@ private static Optional getOneLoanFromMarketplace(final Supplier apiProviderSupplier) { - return Checker.getOneLoanFromMarketplace(apiProviderSupplier) - .map(l -> Checker.notifyProvider(l, provider, username, secret)) + return getOneLoanFromMarketplace(apiProviderSupplier) + .map(l -> notifyProvider(l, provider, username, secret)) .orElse(false); } static boolean notifications(final SessionInfo sessionInfo, final URL configurationLocation) { ListenerServiceLoader.registerConfiguration(sessionInfo, configurationLocation); - return Checker.notifications(sessionInfo, ListenerServiceLoader.load(RoboZonkyTestingEvent.class)); + return notifications(sessionInfo, ListenerServiceLoader.load(RoboZonkyTestingEvent.class)); } static boolean notifications(final SessionInfo sessionInfo, diff --git a/robozonky-cli/src/main/java/com/github/robozonky/cli/GoogleCredentialsFeature.java b/robozonky-cli/src/main/java/com/github/robozonky/cli/GoogleCredentialsFeature.java index cafbeab78..7a8fd3e55 100644 --- a/robozonky-cli/src/main/java/com/github/robozonky/cli/GoogleCredentialsFeature.java +++ b/robozonky-cli/src/main/java/com/github/robozonky/cli/GoogleCredentialsFeature.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -79,7 +79,7 @@ public String describe() { } private T runGoogleCredentialCheck(final SessionInfo sessionInfo, final Function provider) { - LOGGER.debug("Running credential check."); + logger.debug("Running credential check."); final Credential credential = credentialProvider.get().getCredential(sessionInfo); return provider.apply(credential); } @@ -103,11 +103,11 @@ public void runGoogleCredentialCheck() { @Override public void setup() throws SetupFailedException { - LOGGER.info("A web browser window may open, or you may be asked to visit a Google link."); - LOGGER.info("Unless you allow RoboZonky to access your Google Sheets, Stonky integration will be disabled."); + logger.info("A web browser window may open, or you may be asked to visit a Google link."); + logger.info("Unless you allow RoboZonky to access your Google Sheets, Stonky integration will be disabled."); try { runGoogleCredentialCheck(); - LOGGER.info("Press Enter to confirm that you have granted permission, otherwise exit."); + logger.info("Press Enter to confirm that you have granted permission, otherwise exit."); System.in.read(); } catch (final Exception ex) { throw new SetupFailedException(ex); @@ -121,7 +121,7 @@ public void test() throws TestFailedException { final Drive service = runGoogleCredentialCheckForDrive(sessionInfo); final Sheets service2 = runGoogleCredentialCheckForSheets(sessionInfo); final DriveOverview driveOverview = DriveOverview.create(sessionInfo, service, service2); - LOGGER.debug("Google Drive contents: {}.", driveOverview); + logger.debug("Google Drive contents: {}.", driveOverview); } catch (final Exception ex) { throw new TestFailedException(ex); } diff --git a/robozonky-cli/src/main/java/com/github/robozonky/cli/NotificationTestingFeature.java b/robozonky-cli/src/main/java/com/github/robozonky/cli/NotificationTestingFeature.java index 4a4f4e8c7..be07d0680 100644 --- a/robozonky-cli/src/main/java/com/github/robozonky/cli/NotificationTestingFeature.java +++ b/robozonky-cli/src/main/java/com/github/robozonky/cli/NotificationTestingFeature.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,6 +57,6 @@ public void test() throws TestFailedException { if (!success) { throw new TestFailedException("No notifications have been sent. Check log for possible problems."); } - LOGGER.info("Notifications should have been sent now."); + logger.info("Notifications should have been sent now."); } } diff --git a/robozonky-cli/src/main/java/com/github/robozonky/cli/StrategyValidationFeature.java b/robozonky-cli/src/main/java/com/github/robozonky/cli/StrategyValidationFeature.java index d5aeef19f..87ef849ea 100644 --- a/robozonky-cli/src/main/java/com/github/robozonky/cli/StrategyValidationFeature.java +++ b/robozonky-cli/src/main/java/com/github/robozonky/cli/StrategyValidationFeature.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -71,7 +71,7 @@ public void setup() throws SetupFailedException { private void report(final LongAdder adder, final String type) { adder.increment(); - LOGGER.info("{} strategy present.", type); + logger.info("{} strategy present.", type); } @Override diff --git a/robozonky-cli/src/test/java/com/github/robozonky/cli/AbstractFeatureTest.java b/robozonky-cli/src/test/java/com/github/robozonky/cli/AbstractFeatureTest.java index 9c54a0944..b27953ae3 100644 --- a/robozonky-cli/src/test/java/com/github/robozonky/cli/AbstractFeatureTest.java +++ b/robozonky-cli/src/test/java/com/github/robozonky/cli/AbstractFeatureTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,7 +27,7 @@ import org.junit.jupiter.params.provider.MethodSource; import picocli.CommandLine; -import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.*; class AbstractFeatureTest { diff --git a/robozonky-cli/src/test/java/com/github/robozonky/cli/CheckerTest.java b/robozonky-cli/src/test/java/com/github/robozonky/cli/CheckerTest.java index b3ac5e23c..06a1bf4f5 100644 --- a/robozonky-cli/src/test/java/com/github/robozonky/cli/CheckerTest.java +++ b/robozonky-cli/src/test/java/com/github/robozonky/cli/CheckerTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ import org.mockito.Mockito; import org.mockito.junit.jupiter.MockitoExtension; -import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.*; @ExtendWith(MockitoExtension.class) class CheckerTest { diff --git a/robozonky-cli/src/test/java/com/github/robozonky/cli/CliTest.java b/robozonky-cli/src/test/java/com/github/robozonky/cli/CliTest.java index e481c0fa5..906bb7b16 100644 --- a/robozonky-cli/src/test/java/com/github/robozonky/cli/CliTest.java +++ b/robozonky-cli/src/test/java/com/github/robozonky/cli/CliTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,7 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; -import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.*; class CliTest { diff --git a/robozonky-cli/src/test/java/com/github/robozonky/cli/GoogleCredentialsFeatureTest.java b/robozonky-cli/src/test/java/com/github/robozonky/cli/GoogleCredentialsFeatureTest.java index ee26f7246..6db450e74 100644 --- a/robozonky-cli/src/test/java/com/github/robozonky/cli/GoogleCredentialsFeatureTest.java +++ b/robozonky-cli/src/test/java/com/github/robozonky/cli/GoogleCredentialsFeatureTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,8 +28,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.assertj.core.api.Assertions.*; class GoogleCredentialsFeatureTest { diff --git a/robozonky-cli/src/test/java/com/github/robozonky/cli/LogbackConfiguratorTest.java b/robozonky-cli/src/test/java/com/github/robozonky/cli/LogbackConfiguratorTest.java index de1c7ef64..8c40f4845 100644 --- a/robozonky-cli/src/test/java/com/github/robozonky/cli/LogbackConfiguratorTest.java +++ b/robozonky-cli/src/test/java/com/github/robozonky/cli/LogbackConfiguratorTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,11 +23,9 @@ import org.junit.jupiter.api.Test; import org.slf4j.LoggerFactory; -import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.assertj.core.api.Assertions.*; import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.*; class LogbackConfiguratorTest { diff --git a/robozonky-cli/src/test/java/com/github/robozonky/cli/MasterPasswordFeatureTest.java b/robozonky-cli/src/test/java/com/github/robozonky/cli/MasterPasswordFeatureTest.java index 3dd17daea..301d85021 100644 --- a/robozonky-cli/src/test/java/com/github/robozonky/cli/MasterPasswordFeatureTest.java +++ b/robozonky-cli/src/test/java/com/github/robozonky/cli/MasterPasswordFeatureTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,8 +23,7 @@ import com.github.robozonky.common.secrets.KeyStoreHandler; import org.junit.jupiter.api.Test; -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.assertj.core.api.Assertions.*; class MasterPasswordFeatureTest { diff --git a/robozonky-cli/src/test/java/com/github/robozonky/cli/NotificationTestingFeatureTest.java b/robozonky-cli/src/test/java/com/github/robozonky/cli/NotificationTestingFeatureTest.java index 0050a0410..8672b3a93 100644 --- a/robozonky-cli/src/test/java/com/github/robozonky/cli/NotificationTestingFeatureTest.java +++ b/robozonky-cli/src/test/java/com/github/robozonky/cli/NotificationTestingFeatureTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ import org.junit.jupiter.api.Test; -import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.assertj.core.api.Assertions.*; class NotificationTestingFeatureTest { diff --git a/robozonky-cli/src/test/java/com/github/robozonky/cli/StrategyValidationFeatureTest.java b/robozonky-cli/src/test/java/com/github/robozonky/cli/StrategyValidationFeatureTest.java index b464e5b17..0ebea540d 100644 --- a/robozonky-cli/src/test/java/com/github/robozonky/cli/StrategyValidationFeatureTest.java +++ b/robozonky-cli/src/test/java/com/github/robozonky/cli/StrategyValidationFeatureTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,8 +24,7 @@ import com.github.robozonky.internal.api.Defaults; import org.junit.jupiter.api.Test; -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.assertj.core.api.Assertions.*; class StrategyValidationFeatureTest { diff --git a/robozonky-cli/src/test/java/com/github/robozonky/cli/TestingZonkoidProviderService.java b/robozonky-cli/src/test/java/com/github/robozonky/cli/TestingZonkoidProviderService.java index 70076c00c..1faab3669 100644 --- a/robozonky-cli/src/test/java/com/github/robozonky/cli/TestingZonkoidProviderService.java +++ b/robozonky-cli/src/test/java/com/github/robozonky/cli/TestingZonkoidProviderService.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ import com.github.robozonky.api.confirmations.ConfirmationProviderService; import com.github.robozonky.api.confirmations.RequestId; -import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.*; public class TestingZonkoidProviderService implements ConfirmationProviderService { diff --git a/robozonky-cli/src/test/java/com/github/robozonky/cli/ZonkoidPasswordFeatureTest.java b/robozonky-cli/src/test/java/com/github/robozonky/cli/ZonkoidPasswordFeatureTest.java index 01d1ffab3..2cb8bb641 100644 --- a/robozonky-cli/src/test/java/com/github/robozonky/cli/ZonkoidPasswordFeatureTest.java +++ b/robozonky-cli/src/test/java/com/github/robozonky/cli/ZonkoidPasswordFeatureTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,12 +27,10 @@ import org.junit.jupiter.api.Test; import org.mockito.Mockito; -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.assertj.core.api.Assertions.*; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; +import static org.mockito.Mockito.*; class ZonkoidPasswordFeatureTest { diff --git a/robozonky-cli/src/test/java/com/github/robozonky/cli/ZonkyPasswordFeatureTest.java b/robozonky-cli/src/test/java/com/github/robozonky/cli/ZonkyPasswordFeatureTest.java index 1dc5d2397..1933d7ebd 100644 --- a/robozonky-cli/src/test/java/com/github/robozonky/cli/ZonkyPasswordFeatureTest.java +++ b/robozonky-cli/src/test/java/com/github/robozonky/cli/ZonkyPasswordFeatureTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,16 +31,11 @@ import com.github.robozonky.common.secrets.SecretProvider; import org.junit.jupiter.api.Test; -import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.assertj.core.api.Assertions.*; import static org.assertj.core.api.SoftAssertions.assertSoftly; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.doAnswer; -import static org.mockito.Mockito.doThrow; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; +import static org.mockito.Mockito.*; class ZonkyPasswordFeatureTest { diff --git a/robozonky-common/pom.xml b/robozonky-common/pom.xml index c68de2fb8..f100d4c75 100644 --- a/robozonky-common/pom.xml +++ b/robozonky-common/pom.xml @@ -1,6 +1,6 @@ ch.qos.logback logback-classic diff --git a/robozonky-installer/src/main/java/com/github/robozonky/installer/AbstractEmailServerValidator.java b/robozonky-installer/src/main/java/com/github/robozonky/installer/AbstractEmailServerValidator.java index 8304d25e7..3613df511 100644 --- a/robozonky-installer/src/main/java/com/github/robozonky/installer/AbstractEmailServerValidator.java +++ b/robozonky-installer/src/main/java/com/github/robozonky/installer/AbstractEmailServerValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,12 +42,12 @@ protected Status validateDataPossiblyThrowingException(final InstallData install .of(transport -> { final String host = Variables.SMTP_HOSTNAME.getValue(installData); final int port = Integer.parseInt(Variables.SMTP_PORT.getValue(installData)); - LOGGER.debug("Connecting to {}:{} with {}.", host, port, smtpProps); + logger.debug("Connecting to {}:{} with {}.", host, port, smtpProps); transport.connect(host, port, Variables.SMTP_USERNAME.getValue(installData), Variables.SMTP_PASSWORD.getValue(installData)); return DataValidator.Status.OK; }).getOrElseGet(t -> { - LOGGER.warn("Failed authenticating with SMTP server.", t); + logger.warn("Failed authenticating with SMTP server.", t); return DataValidator.Status.WARNING; }); } diff --git a/robozonky-installer/src/main/java/com/github/robozonky/installer/AbstractValidator.java b/robozonky-installer/src/main/java/com/github/robozonky/installer/AbstractValidator.java index acbfdd5f8..cde7365fa 100644 --- a/robozonky-installer/src/main/java/com/github/robozonky/installer/AbstractValidator.java +++ b/robozonky-installer/src/main/java/com/github/robozonky/installer/AbstractValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,12 +24,12 @@ import com.izforge.izpack.api.data.InstallData; import com.izforge.izpack.api.installer.DataValidator; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; abstract class AbstractValidator implements DataValidator { - protected final Logger LOGGER = LoggerFactory.getLogger(this.getClass()); + protected final Logger logger = LogManager.getLogger(this.getClass()); protected abstract DataValidator.Status validateDataPossiblyThrowingException(InstallData installData); @@ -37,16 +37,16 @@ abstract class AbstractValidator implements DataValidator { public DataValidator.Status validateData(final InstallData installData) { final ExecutorService e = Executors.newCachedThreadPool(); try { - LOGGER.info("Starting validation."); + logger.info("Starting validation."); final Callable c = () -> this.validateDataPossiblyThrowingException(installData); final Future f = e.submit(c); return f.get(15, TimeUnit.SECONDS); // don't wait for result indefinitely } catch (final Exception ex) { // the installer must never ever throw an exception (= neverending spinner) - LOGGER.error("Uncaught exception.", ex); + logger.error("Uncaught exception.", ex); return DataValidator.Status.ERROR; } finally { e.shutdownNow(); - LOGGER.info("Finished validation."); + logger.info("Finished validation."); } } diff --git a/robozonky-installer/src/main/java/com/github/robozonky/installer/EmailSettingsValidator.java b/robozonky-installer/src/main/java/com/github/robozonky/installer/EmailSettingsValidator.java index c41531658..8723cb5d6 100644 --- a/robozonky-installer/src/main/java/com/github/robozonky/installer/EmailSettingsValidator.java +++ b/robozonky-installer/src/main/java/com/github/robozonky/installer/EmailSettingsValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,7 @@ protected DataValidator.Status validateDataPossiblyThrowingException(final Insta f.test(); return DataValidator.Status.OK; } catch (final Exception ex) { - LOGGER.warn("Failed sending e-mail.", ex); + logger.warn("Failed sending e-mail.", ex); return DataValidator.Status.WARNING; } } diff --git a/robozonky-installer/src/main/java/com/github/robozonky/installer/RoboZonkyInstallerListener.java b/robozonky-installer/src/main/java/com/github/robozonky/installer/RoboZonkyInstallerListener.java index 7ce2b6bcc..d32558455 100644 --- a/robozonky-installer/src/main/java/com/github/robozonky/installer/RoboZonkyInstallerListener.java +++ b/robozonky-installer/src/main/java/com/github/robozonky/installer/RoboZonkyInstallerListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,8 +41,8 @@ import com.izforge.izpack.api.event.ProgressListener; import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.SystemUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import static com.github.robozonky.integrations.stonky.Properties.GOOGLE_CALLBACK_HOST; import static com.github.robozonky.integrations.stonky.Properties.GOOGLE_CALLBACK_PORT; @@ -51,7 +51,7 @@ public final class RoboZonkyInstallerListener extends AbstractInstallerListener { static final char[] KEYSTORE_PASSWORD = UUID.randomUUID().toString().toCharArray(); - private static final Logger LOGGER = LoggerFactory.getLogger(RoboZonkyInstallerListener.class); + private static final Logger LOGGER = LogManager.getLogger(RoboZonkyInstallerListener.class); static File INSTALL_PATH, DIST_PATH, KEYSTORE_FILE, JMX_PROPERTIES_FILE, EMAIL_CONFIG_FILE, SETTINGS_FILE, CLI_CONFIG_FILE, LOGBACK_CONFIG_FILE; private static InstallData DATA; diff --git a/robozonky-installer/src/main/java/com/github/robozonky/installer/StrategySettingsValidator.java b/robozonky-installer/src/main/java/com/github/robozonky/installer/StrategySettingsValidator.java index d87d64ec9..b8801bb72 100644 --- a/robozonky-installer/src/main/java/com/github/robozonky/installer/StrategySettingsValidator.java +++ b/robozonky-installer/src/main/java/com/github/robozonky/installer/StrategySettingsValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,7 @@ public DataValidator.Status validateDataPossiblyThrowingException(final InstallD f.test(); return DataValidator.Status.OK; } catch (final Exception ex) { - LOGGER.warn("Strategy invalid: {}.", strategySource, ex); + logger.warn("Strategy invalid: {}.", strategySource, ex); return DataValidator.Status.WARNING; } } diff --git a/robozonky-installer/src/main/java/com/github/robozonky/installer/Util.java b/robozonky-installer/src/main/java/com/github/robozonky/installer/Util.java index 1a1b24269..541c88ee3 100644 --- a/robozonky-installer/src/main/java/com/github/robozonky/installer/Util.java +++ b/robozonky-installer/src/main/java/com/github/robozonky/installer/Util.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,12 +29,12 @@ import com.github.robozonky.internal.api.Defaults; import com.izforge.izpack.api.data.InstallData; import io.vavr.control.Try; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; final class Util { - private static final Logger LOGGER = LoggerFactory.getLogger(Util.class); + private static final Logger LOGGER = LogManager.getLogger(Util.class); private Util() { // no instances diff --git a/robozonky-installer/src/main/java/com/github/robozonky/installer/ZonkySettingsValidator.java b/robozonky-installer/src/main/java/com/github/robozonky/installer/ZonkySettingsValidator.java index 39adb2f93..be87708ce 100644 --- a/robozonky-installer/src/main/java/com/github/robozonky/installer/ZonkySettingsValidator.java +++ b/robozonky-installer/src/main/java/com/github/robozonky/installer/ZonkySettingsValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,10 +53,10 @@ public DataValidator.Status validateDataPossiblyThrowingException(final InstallD return DataValidator.Status.OK; } catch (final TestFailedException t) { if (t.getCause() instanceof ServerErrorException) { - LOGGER.error("Failed accessing Zonky.", t); + logger.error("Failed accessing Zonky.", t); return DataValidator.Status.ERROR; } else { - LOGGER.warn("Failed logging in.", t); + logger.warn("Failed logging in.", t); return DataValidator.Status.WARNING; } } diff --git a/robozonky-installer/src/main/java/com/github/robozonky/installer/scripts/RunScriptGenerator.java b/robozonky-installer/src/main/java/com/github/robozonky/installer/scripts/RunScriptGenerator.java index 7086c90f5..47d447ce8 100644 --- a/robozonky-installer/src/main/java/com/github/robozonky/installer/scripts/RunScriptGenerator.java +++ b/robozonky-installer/src/main/java/com/github/robozonky/installer/scripts/RunScriptGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,14 +27,14 @@ import com.github.robozonky.internal.api.Defaults; import com.github.robozonky.internal.util.Maps; import freemarker.template.TemplateException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import static com.github.robozonky.internal.util.Maps.entry; public abstract class RunScriptGenerator implements Function { - private static final Logger LOGGER = LoggerFactory.getLogger(RunScriptGenerator.class.getSimpleName()); + private static final Logger LOGGER = LogManager.getLogger(RunScriptGenerator.class.getSimpleName()); protected final File configFile, distributionDirectory; protected RunScriptGenerator(final File distributionDirectory, final File configFile) { diff --git a/robozonky-installer/src/test/java/com/github/robozonky/installer/AbstractValidatorTest.java b/robozonky-installer/src/test/java/com/github/robozonky/installer/AbstractValidatorTest.java index dd5a1c3c1..76a1fdfdd 100644 --- a/robozonky-installer/src/test/java/com/github/robozonky/installer/AbstractValidatorTest.java +++ b/robozonky-installer/src/test/java/com/github/robozonky/installer/AbstractValidatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ import com.izforge.izpack.api.installer.DataValidator; import org.junit.jupiter.api.Test; -import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.*; class AbstractValidatorTest { diff --git a/robozonky-installer/src/test/java/com/github/robozonky/installer/AdvancedEmailServerValidatorTest.java b/robozonky-installer/src/test/java/com/github/robozonky/installer/AdvancedEmailServerValidatorTest.java index 94aff39c4..8076465fd 100644 --- a/robozonky-installer/src/test/java/com/github/robozonky/installer/AdvancedEmailServerValidatorTest.java +++ b/robozonky-installer/src/test/java/com/github/robozonky/installer/AdvancedEmailServerValidatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,22 +23,20 @@ import com.icegreen.greenmail.util.ServerSetupTest; import com.izforge.izpack.api.data.InstallData; import com.izforge.izpack.api.installer.DataValidator; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.*; import static org.assertj.core.api.SoftAssertions.assertSoftly; -import static org.mockito.Mockito.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; +import static org.mockito.Mockito.*; class AdvancedEmailServerValidatorTest { private static final GreenMail EMAIL = new GreenMail(getServerSetup()); - private static final Logger LOGGER = LoggerFactory.getLogger(AdvancedEmailServerValidatorTest.class); + private static final Logger LOGGER = LogManager.getLogger(AdvancedEmailServerValidatorTest.class); private static final String PASSWORD = UUID.randomUUID().toString(); private static final String USERNAME = "sender@server.cz"; diff --git a/robozonky-installer/src/test/java/com/github/robozonky/installer/CommandLinePartTest.java b/robozonky-installer/src/test/java/com/github/robozonky/installer/CommandLinePartTest.java index 51636b8a3..fd53b59be 100644 --- a/robozonky-installer/src/test/java/com/github/robozonky/installer/CommandLinePartTest.java +++ b/robozonky-installer/src/test/java/com/github/robozonky/installer/CommandLinePartTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.*; -import static org.assertj.core.api.SoftAssertions.*; +import static org.assertj.core.api.SoftAssertions.assertSoftly; class CommandLinePartTest { diff --git a/robozonky-installer/src/test/java/com/github/robozonky/installer/EmailSettingsValidatorTest.java b/robozonky-installer/src/test/java/com/github/robozonky/installer/EmailSettingsValidatorTest.java index 075849478..e5f03e11f 100644 --- a/robozonky-installer/src/test/java/com/github/robozonky/installer/EmailSettingsValidatorTest.java +++ b/robozonky-installer/src/test/java/com/github/robozonky/installer/EmailSettingsValidatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,22 +23,20 @@ import com.icegreen.greenmail.util.ServerSetupTest; import com.izforge.izpack.api.data.InstallData; import com.izforge.izpack.api.installer.DataValidator; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.*; import static org.assertj.core.api.SoftAssertions.assertSoftly; -import static org.mockito.Mockito.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; +import static org.mockito.Mockito.*; class EmailSettingsValidatorTest { private static final GreenMail EMAIL = new GreenMail(getServerSetup()); - private static final Logger LOGGER = LoggerFactory.getLogger(EmailSettingsValidatorTest.class); + private static final Logger LOGGER = LogManager.getLogger(EmailSettingsValidatorTest.class); private static ServerSetup getServerSetup() { final ServerSetup setup = ServerSetupTest.SMTP; diff --git a/robozonky-installer/src/test/java/com/github/robozonky/installer/RoboZonkyInstallerListenerTest.java b/robozonky-installer/src/test/java/com/github/robozonky/installer/RoboZonkyInstallerListenerTest.java index 020c3a79a..ce75f408f 100644 --- a/robozonky-installer/src/test/java/com/github/robozonky/installer/RoboZonkyInstallerListenerTest.java +++ b/robozonky-installer/src/test/java/com/github/robozonky/installer/RoboZonkyInstallerListenerTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,14 +36,9 @@ import org.junit.jupiter.api.condition.EnabledOnOs; import org.junit.jupiter.api.condition.OS; -import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.*; import static org.assertj.core.api.SoftAssertions.assertSoftly; -import static org.mockito.Mockito.anyInt; -import static org.mockito.Mockito.anyString; -import static org.mockito.Mockito.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; +import static org.mockito.Mockito.*; import static org.mockito.internal.verification.VerificationModeFactory.times; class RoboZonkyInstallerListenerTest extends AbstractRoboZonkyTest { diff --git a/robozonky-installer/src/test/java/com/github/robozonky/installer/SimpleEmailServerValidatorTest.java b/robozonky-installer/src/test/java/com/github/robozonky/installer/SimpleEmailServerValidatorTest.java index 45cd15dd1..234542839 100644 --- a/robozonky-installer/src/test/java/com/github/robozonky/installer/SimpleEmailServerValidatorTest.java +++ b/robozonky-installer/src/test/java/com/github/robozonky/installer/SimpleEmailServerValidatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,23 +23,20 @@ import com.icegreen.greenmail.util.ServerSetupTest; import com.izforge.izpack.api.data.InstallData; import com.izforge.izpack.api.installer.DataValidator; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.*; import static org.assertj.core.api.SoftAssertions.assertSoftly; -import static org.mockito.Mockito.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; +import static org.mockito.Mockito.*; class SimpleEmailServerValidatorTest { private static final GreenMail EMAIL = new GreenMail(getServerSetup()); - private static final Logger LOGGER = LoggerFactory.getLogger(SimpleEmailServerValidatorTest.class); + private static final Logger LOGGER = LogManager.getLogger(SimpleEmailServerValidatorTest.class); private static final String PASSWORD = UUID.randomUUID().toString(); private static final String USERNAME = "sender@server.cz"; diff --git a/robozonky-installer/src/test/java/com/github/robozonky/installer/StrategySettingsValidatorTest.java b/robozonky-installer/src/test/java/com/github/robozonky/installer/StrategySettingsValidatorTest.java index 65de86339..9df0b8d87 100644 --- a/robozonky-installer/src/test/java/com/github/robozonky/installer/StrategySettingsValidatorTest.java +++ b/robozonky-installer/src/test/java/com/github/robozonky/installer/StrategySettingsValidatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,11 +28,9 @@ import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.Test; -import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.*; import static org.assertj.core.api.SoftAssertions.assertSoftly; -import static org.mockito.Mockito.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; +import static org.mockito.Mockito.*; class StrategySettingsValidatorTest { diff --git a/robozonky-installer/src/test/java/com/github/robozonky/installer/UtilTest.java b/robozonky-installer/src/test/java/com/github/robozonky/installer/UtilTest.java index ad83a1e6c..61ce8ab82 100644 --- a/robozonky-installer/src/test/java/com/github/robozonky/installer/UtilTest.java +++ b/robozonky-installer/src/test/java/com/github/robozonky/installer/UtilTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ import com.github.robozonky.internal.util.Maps; import org.junit.jupiter.api.Test; -import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.*; class UtilTest { diff --git a/robozonky-installer/src/test/java/com/github/robozonky/installer/VariablesTest.java b/robozonky-installer/src/test/java/com/github/robozonky/installer/VariablesTest.java index dd49d21c2..0f109baa2 100644 --- a/robozonky-installer/src/test/java/com/github/robozonky/installer/VariablesTest.java +++ b/robozonky-installer/src/test/java/com/github/robozonky/installer/VariablesTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,10 +24,8 @@ import com.izforge.izpack.api.data.InstallData; import org.junit.jupiter.api.Test; -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; +import static org.assertj.core.api.Assertions.*; +import static org.mockito.Mockito.*; class VariablesTest { diff --git a/robozonky-installer/src/test/java/com/github/robozonky/installer/ZonkoidSettingsValidatorTest.java b/robozonky-installer/src/test/java/com/github/robozonky/installer/ZonkoidSettingsValidatorTest.java index 1ba644606..13bdadd58 100644 --- a/robozonky-installer/src/test/java/com/github/robozonky/installer/ZonkoidSettingsValidatorTest.java +++ b/robozonky-installer/src/test/java/com/github/robozonky/installer/ZonkoidSettingsValidatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.*; -import static org.assertj.core.api.SoftAssertions.*; +import static org.assertj.core.api.SoftAssertions.assertSoftly; import static org.mockito.Mockito.*; class ZonkoidSettingsValidatorTest { diff --git a/robozonky-installer/src/test/java/com/github/robozonky/installer/ZonkySettingsValidatorTest.java b/robozonky-installer/src/test/java/com/github/robozonky/installer/ZonkySettingsValidatorTest.java index 18b1c1eb1..0e0f89a67 100644 --- a/robozonky-installer/src/test/java/com/github/robozonky/installer/ZonkySettingsValidatorTest.java +++ b/robozonky-installer/src/test/java/com/github/robozonky/installer/ZonkySettingsValidatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,14 +31,9 @@ import com.izforge.izpack.api.installer.DataValidator; import org.junit.jupiter.api.Test; -import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.*; import static org.assertj.core.api.SoftAssertions.assertSoftly; -import static org.mockito.Mockito.any; -import static org.mockito.Mockito.doAnswer; -import static org.mockito.Mockito.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; +import static org.mockito.Mockito.*; class ZonkySettingsValidatorTest { diff --git a/robozonky-installer/src/test/java/com/github/robozonky/installer/scripts/RunScriptGeneratorTest.java b/robozonky-installer/src/test/java/com/github/robozonky/installer/scripts/RunScriptGeneratorTest.java index c5fa9b17d..457acfd0c 100644 --- a/robozonky-installer/src/test/java/com/github/robozonky/installer/scripts/RunScriptGeneratorTest.java +++ b/robozonky-installer/src/test/java/com/github/robozonky/installer/scripts/RunScriptGeneratorTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 The RoboZonky Project + * Copyright 2019 The RoboZonky Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.*; -import static org.assertj.core.api.SoftAssertions.*; +import static org.assertj.core.api.SoftAssertions.assertSoftly; class RunScriptGeneratorTest { diff --git a/robozonky-integration-stonky/pom.xml b/robozonky-integration-stonky/pom.xml index 29aad0da7..fa2fc625d 100644 --- a/robozonky-integration-stonky/pom.xml +++ b/robozonky-integration-stonky/pom.xml @@ -1,6 +1,6 @@