Skip to content

Commit

Permalink
Ensure system env var is populated
Browse files Browse the repository at this point in the history
  • Loading branch information
manojlds committed May 11, 2017
1 parent 1b62daa commit 5ef816d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 3 additions & 2 deletions utils/src/main/java/com/indix/gocd/utils/GoEnvironment.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@
*/
public class GoEnvironment {
private Pattern envPat = Pattern.compile("\\$\\{(\\w+)\\}");
private Map<String, String> environment = new HashMap<String, String>();
private Map<String, String> environment = new HashMap<>();

public GoEnvironment() {
this(System.getenv());
this.environment.putAll(System.getenv());
}

public GoEnvironment(Map<String, String> defaultEnvironment) {
this();
this.environment.putAll(defaultEnvironment);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ public void shouldNotReplaceUnknownEnvVariables() {

assertThat(replaced, is("COUNT:1 ${DOESNT_EXIST}"));
}



@Test
public void shouldGetHasAWSUseIamRoleTrueIfSetToTrue() {
GoEnvironment sut = new GoEnvironment(mockEnvironmentVariables
Expand Down

0 comments on commit 5ef816d

Please sign in to comment.