-
Notifications
You must be signed in to change notification settings - Fork 4
Extracted configurations #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
updated com.fasterxml.jackson.core to 2.10.2
…e' into Feature/11-LoggerConfiguration
…Configuration # Conflicts: # src/test/java/tests/configurations/EnvConfigurationTests.java
…Configuration # Conflicts: # src/test/java/tests/configurations/EnvConfigurationTests.java
# Conflicts: # src/main/java/aquality/selenium/core/application/AqualityModule.java # src/main/java/aquality/selenium/core/application/AqualityServices.java # src/test/java/tests/logger/LoggerTests.java
…erConfiguration # Conflicts: # src/main/java/aquality/selenium/core/application/AqualityModule.java # src/test/resources/TestSuite.xml
…Configuration # Conflicts: # src/test/java/tests/configurations/EnvConfigurationTests.java
…Configuration # Conflicts: # src/main/java/aquality/selenium/core/application/AqualityModule.java # src/test/java/tests/configurations/EnvConfigurationTests.java
# Conflicts: # src/main/java/aquality/selenium/core/application/AqualityModule.java # src/test/java/tests/utilities/CustomSettingsFileTests.java # src/test/java/tests/utilities/SettingsFileTests.java # src/test/resources/TestSuite.xml # src/test/resources/settings.json # src/test/resources/settings.local.json
src/main/java/aquality/selenium/core/configurations/ILoggerConfiguration.java
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,5 @@ | |||
package aquality.selenium.core.localization; | |||
|
|||
public enum SupportedLanguage { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we would not need this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
|
||
@Test | ||
public void testShouldBePossibleToGetLanguageFromNewSettingsFile() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redundant empty line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
} | ||
|
||
@AfterMethod | ||
public void after() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure that this overriding of base class's method would work as expected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
public interface ILoggerConfiguration { | ||
|
||
/** | ||
* Gets language of the library. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe 'of the logger' instead of 'of the library.'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
|
||
public class ElementCacheConfiguration implements IElementCacheConfiguration{ | ||
|
||
private static final String JSON_PATH = "/elementCache/isEnabled"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you please rename as IS_ENABLED_PATH
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
private SettingsFileUtil() { | ||
} | ||
|
||
public static Object getValueOrDefault(ISettingsFile settingsFile, String path, Object defaultValue) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we move this in the default method of interface to remove this utility class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
getNumberAction.run(); | ||
} catch (Exception e) { | ||
Assert.assertSame(e.getCause().getClass(), NumberFormatException.class); | ||
Assert.assertTrue(e.getMessage().contains("NumberFormatException")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it necessary after first verification on exception type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if nedded second assert. Type of exception should be NumberFormatException
} | ||
|
||
private long getTimeout(TIMEOUT timeout){ | ||
return Long.valueOf(settingsFile.getValue("/timeouts/" + timeout.getKey()).toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would not it be better to move "/timeouts/" in the enumeration to keep full jsonpath in the one place? and getKey can be renamed to getPath or something like that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree
Kudos, SonarCloud Quality Gate passed!
|
PR Details
Related Issue Link:
#11
How Has This Been Tested
tests.configurations.EnvConfigurationTests
tests.configurations.ProfileConfigurationTests
tests.configurations.LoggerConfigurationTests
tests.configurations.TimeoutConfigurationTests
tests.configurations.RetryConfigurationTests
tests.configurations.ElementCacheConfigurationTests
Checklist