File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
test/java/selenium/testdata/file Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ package config ;
2
+
3
+ import com .google .common .base .Preconditions ;
4
+ import org .springframework .beans .factory .annotation .Autowired ;
5
+ import org .springframework .context .annotation .Bean ;
6
+ import org .springframework .context .annotation .Configuration ;
7
+ import org .springframework .core .env .Environment ;
8
+
9
+ @ Configuration
10
+ public class DomainConfiguration {
11
+
12
+ public static final AppDomain APP_DOMAIN = getAppDomain ();
13
+
14
+ @ Autowired
15
+ private Environment env ;
16
+
17
+ private static AppDomain getAppDomain () {
18
+ final String countryCode = System .getProperty ("country" );
19
+ Preconditions .checkNotNull (countryCode , "\" country\" system property missing" );
20
+ return AppDomain .fromCountryCode (countryCode );
21
+ }
22
+
23
+ @ Bean (name = "appUrl" )
24
+ public String appUrl () {
25
+ return env .getProperty ("appUrl." + APP_DOMAIN .getCountryCode ());
26
+ }
27
+
28
+ @ Bean (name = "browser" )
29
+ public String browser () {
30
+ return env .getProperty ("browser" );
31
+ }
32
+ }
Original file line number Diff line number Diff line change 1
1
package selenium .testdata .file ;
2
2
3
3
import com .fasterxml .jackson .databind .ObjectMapper ;
4
+ import config .DomainConfiguration ;
4
5
import org .springframework .beans .factory .annotation .Autowired ;
5
6
import org .springframework .core .io .Resource ;
6
7
import org .springframework .core .io .ResourceLoader ;
You can’t perform that action at this time.
0 commit comments