Skip to content

Commit

Permalink
Merge pull request #18 from nirmalvp/bugfix/host_env_fix
Browse files Browse the repository at this point in the history
Fix bug which ignored AMADEUS_HOST property provided by environment
  • Loading branch information
anthonyroux authored Oct 28, 2018
2 parents cd238fb + e90317d commit 78e7685
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/com/amadeus/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public Configuration setSsl(Boolean ssl) {
// Parses environment variables and initializes the values.
protected Configuration parseEnvironment(Map<String, String> environment) {
setHostname(getOrDefault(environment, "HOSTNAME", hostname));
setHost(getOrDefault(environment, "HOOST", host));
setHost(getOrDefault(environment, "HOST", host));
setLogLevel(getOrDefault(environment, "LOG_LEVEL", logLevel));
setSsl(Boolean.parseBoolean(getOrDefault(environment, "SSL", String.valueOf(ssl))));
setPort(Integer.parseInt(getOrDefault(environment, "PORT", String.valueOf(port))));
Expand Down
2 changes: 2 additions & 0 deletions src/test/java/com/amadeus/AmadeusTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public void testBuilderWithNullClientSecret() {
put("AMADEUS_CLIENT_SECRET", "234");
put("AMADEUS_LOG_LEVEL", "debug");
put("AMADEUS_PORT", "123");
put("AMADEUS_HOST", "my.custom.host.com");
}
};
assertTrue("should return a Configuration",
Expand All @@ -39,6 +40,7 @@ public void testBuilderWithNullClientSecret() {
Amadeus amadeus = Amadeus.builder(environment).build();
assertEquals(amadeus.getConfiguration().getLogLevel(), "debug");
assertEquals(amadeus.getConfiguration().getPort(), 123);
assertEquals(amadeus.getConfiguration().getHost(), "my.custom.host.com");
}

/*
Expand Down

0 comments on commit 78e7685

Please sign in to comment.