File tree Expand file tree Collapse file tree
agent/src/main/java/com/teamscale/jacoco/agent/options Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -127,14 +127,7 @@ public void throwOnCollectedErrors() throws Exception {
127127 AgentOptions options = new AgentOptions (logger );
128128 options .originalOptionsString = optionsString ;
129129
130- if (credentials != null ) {
131- options .teamscaleServer .url = credentials .url ;
132- options .teamscaleServer .userName = credentials .userName ;
133- options .teamscaleServer .userAccessToken = credentials .accessKey ;
134- }
135- if (environmentAccessToken != null ) {
136- options .teamscaleServer .userAccessToken = environmentAccessToken ;
137- }
130+ presetCredentialOptions (options );
138131
139132 if (!StringUtils .isEmpty (optionsString )) {
140133 String [] optionParts = optionsString .split ("," );
@@ -162,6 +155,17 @@ public void throwOnCollectedErrors() throws Exception {
162155 return options ;
163156 }
164157
158+ private void presetCredentialOptions (AgentOptions options ) {
159+ if (credentials != null ) {
160+ options .teamscaleServer .url = credentials .url ;
161+ options .teamscaleServer .userName = credentials .userName ;
162+ options .teamscaleServer .userAccessToken = credentials .accessKey ;
163+ }
164+ if (environmentAccessToken != null ) {
165+ options .teamscaleServer .userAccessToken = environmentAccessToken ;
166+ }
167+ }
168+
165169 /**
166170 * Stores the agent options for proxies in the {@link TeamscaleProxySystemProperties} and overwrites the password
167171 * with the password found in the proxy-password-file if necessary.
You can’t perform that action at this time.
0 commit comments