Skip to content

Commit

Permalink
Merge pull request #239 from eliasnogueira/refactor
Browse files Browse the repository at this point in the history
Refactor
  • Loading branch information
eliasnogueira authored Jan 27, 2024
2 parents ba48961 + f1fbe49 commit 40978c5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.eliasnogueira</groupId>
<artifactId>selenium-java-lean-test-architecture</artifactId>
<version>3.3.8</version>
<version>3.3.9</version>

<scm>
<connection>scm:[email protected]:eliasnogueira/selenium-java-lean-test-architecture.git</connection>
Expand Down Expand Up @@ -35,7 +35,7 @@
<allure.cmd.download.url>
https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline
</allure.cmd.download.url>
<testcontainers.selenium.version>1.19.3</testcontainers.selenium.version>
<testcontainers.selenium.version>1.19.4</testcontainers.selenium.version>

<!-- security libraries override -->
<jackson-databind.version>2.16.1</jackson-databind.version>
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/eliasnogueira/config/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
@Config.Sources({
"system:properties",
"classpath:general.properties",
"classpath:local.properties",
"classpath:selenium-grid.properties"})
public interface Configuration extends Config {

Expand Down
10 changes: 7 additions & 3 deletions src/main/java/com/eliasnogueira/enums/Target.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@

public enum Target {

LOCAL("local"), LOCAL_SUITE("local-suite"), SELENIUM_GRID("selenium-grid"), TESTCONTAINERS("testcontainers");
LOCAL("local"), LOCAL_SUITE("local-suite"), SELENIUM_GRID("selenium-grid"),
TESTCONTAINERS("testcontainers");

private final String value;
private static final Map<String, Target> ENUM_MAP;
Expand All @@ -43,12 +44,15 @@ public enum Target {
}

static {
Map<String, Target> map = stream(Target.values()).collect(toMap(
instance -> instance.value.toLowerCase(), instance -> instance, (a, b) -> b, ConcurrentHashMap::new));
Map<String, Target> map = stream(Target.values())
.collect(toMap(instance -> instance.value.toLowerCase(), instance -> instance, (a, b) -> b, ConcurrentHashMap::new));
ENUM_MAP = Collections.unmodifiableMap(map);
}

public static Target get(String value) {
if (!ENUM_MAP.containsKey(value.toLowerCase()))
throw new IllegalArgumentException(String.format("Value %s not valid. Use one of the TARGET enum values", value));

return ENUM_MAP.get(value.toLowerCase());
}
}
2 changes: 1 addition & 1 deletion src/test/resources/general.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ target = local
browser = chrome

# initial URL
url.base = http://eliasnogueira.com/external/selenium-java-architecture/
url.base = https://eliasnogueira.com/external/selenium-java-architecture/

# global test timeout
timeout = 3
Expand Down

0 comments on commit 40978c5

Please sign in to comment.