java/com.sap.sailing.windestimation.test/src/com/sap/sailing/windestimation/integration/IncrementalMstHmmWindEstimationForTrackedRaceTest.java
... ...
@@ -7,6 +7,8 @@ import java.io.File;
7 7
import java.io.IOException;
8 8
import java.net.URI;
9 9
import java.net.URL;
10
+import java.nio.charset.StandardCharsets;
11
+import java.security.MessageDigest;
10 12
import java.text.SimpleDateFormat;
11 13
import java.util.ArrayList;
12 14
import java.util.Collections;
... ...
@@ -137,6 +139,19 @@ public class IncrementalMstHmmWindEstimationForTrackedRaceTest extends OnlineTra
137 139
polarDataBearerToken = System.getenv("POLAR_DATA_BEARER_TOKEN");
138 140
if (polarDataBearerToken == null) {
139 141
logger.warning("Couldn't find POLAR_DATA_BEARER_TOKEN environment variable either, polar data service will not be available");
142
+ } else {
143
+ final byte[] digest = MessageDigest.getInstance("SHA-256").digest(polarDataBearerToken.getBytes(StandardCharsets.UTF_8));
144
+ final StringBuilder hexString = new StringBuilder();
145
+ for (byte b : digest) {
146
+ String hex = Integer.toHexString(0xff & b);
147
+ if (hex.length() == 1) {
148
+ hexString.append('0');
149
+ }
150
+ hexString.append(hex);
151
+ }
152
+ logger.info("Found POLAR_DATA_BEARER_TOKEN environment variable, length "+polarDataBearerToken.length()
153
+ +", SHA256 hash "+hexString.toString()
154
+ +"; polar data service will be available");
140 155
}
141 156
} else {
142 157
logger.info("Found polardata.source.bearertoken system property, polar data service will be available");