blob: 6cc3b75500056349974d4096b1d7f49332130163 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
package org.onap.appc.flow.controller.node;
import java.util.function.Function;
/**
* Wrapper for accessing environment variables
*/
class EnvVariables {
private Function<String, String> envSupplier;
EnvVariables() {
envSupplier = System::getenv;
}
/**
* Allows to override environment variables in tests, prefer to use default constructor
*/
EnvVariables(Function<String, String> envSupplier) {
this.envSupplier = envSupplier;
}
String getenv(String variable) {
return envSupplier.apply(variable);
}
}
|