c8bcc3af0f53ba852a4c165bbc26cb31637584b9
java/com.sap.sailing.polars.test/src/com/sap/sailing/polars/jaxrs/api/test/PolarDataClientMock.java
| ... | ... | @@ -1,30 +0,0 @@ |
| 1 | -package com.sap.sailing.polars.jaxrs.api.test; |
|
| 2 | - |
|
| 3 | -import java.io.File; |
|
| 4 | -import java.io.FileInputStream; |
|
| 5 | -import java.io.IOException; |
|
| 6 | -import java.io.InputStream; |
|
| 7 | -import java.util.Optional; |
|
| 8 | - |
|
| 9 | -import org.json.simple.parser.ParseException; |
|
| 10 | - |
|
| 11 | -import com.sap.sailing.domain.base.DomainFactory; |
|
| 12 | -import com.sap.sailing.polars.ReplicablePolarService; |
|
| 13 | -import com.sap.sailing.polars.jaxrs.client.PolarDataClient; |
|
| 14 | - |
|
| 15 | -public class PolarDataClientMock extends PolarDataClient { |
|
| 16 | - |
|
| 17 | - private final File file; |
|
| 18 | - |
|
| 19 | - public PolarDataClientMock(File file, ReplicablePolarService polarService, DomainFactory domainFactory) { |
|
| 20 | - super(null, polarService, Optional.empty()); |
|
| 21 | - polarService.registerDomainFactory(domainFactory); |
|
| 22 | - this.file = file; |
|
| 23 | - } |
|
| 24 | - |
|
| 25 | - @Override |
|
| 26 | - protected InputStream getContentFromResponse() throws IOException, ParseException { |
|
| 27 | - return new FileInputStream(file); |
|
| 28 | - } |
|
| 29 | - |
|
| 30 | -} |
java/com.sap.sailing.polars.test/src/com/sap/sailing/polars/jaxrs/api/test/PolarDataResourceTest.java
| ... | ... | @@ -19,6 +19,7 @@ import com.sap.sailing.domain.base.impl.DomainFactoryImpl; |
| 19 | 19 | import com.sap.sailing.domain.common.LegType; |
| 20 | 20 | import com.sap.sailing.domain.common.polars.NotEnoughDataHasBeenAddedException; |
| 21 | 21 | import com.sap.sailing.polars.impl.PolarDataServiceImpl; |
| 22 | +import com.sap.sailing.polars.jaxrs.client.FileBasedPolarDataClient; |
|
| 22 | 23 | |
| 23 | 24 | public class PolarDataResourceTest { |
| 24 | 25 | private static final Logger logger = Logger.getLogger(PolarDataResourceTest.class.getName()); |
| ... | ... | @@ -35,7 +36,7 @@ public class PolarDataResourceTest { |
| 35 | 36 | public void setUp() throws IOException, ParseException, ClassNotFoundException, InterruptedException { |
| 36 | 37 | polarService = new PolarDataServiceImpl(); |
| 37 | 38 | domainFactory = new DomainFactoryImpl(/* raceLogResolver */ null); |
| 38 | - final PolarDataClientMock client = new PolarDataClientMock(new File("resources/polar_data"), polarService, domainFactory); |
|
| 39 | + final FileBasedPolarDataClient client = new FileBasedPolarDataClient(new File("resources/polar_data"), polarService, domainFactory); |
|
| 39 | 40 | client.updatePolarDataRegressions(); |
| 40 | 41 | // ensure that setting the domain factory has worked |
| 41 | 42 | polarService.runWithDomainFactory(domainFactory -> { |
| ... | ... | @@ -48,7 +49,7 @@ public class PolarDataResourceTest { |
| 48 | 49 | } |
| 49 | 50 | |
| 50 | 51 | /** |
| 51 | - * Test to check if client importing data correctly. Using {@link PolarDataClientMock} which use {@link File} |
|
| 52 | + * Test to check if client importing data correctly. Using {@link FileBasedPolarDataClient} which use {@link File} |
|
| 52 | 53 | * polar_data.json as source |
| 53 | 54 | * |
| 54 | 55 | * @throws NotEnoughDataHasBeenAddedException |
java/com.sap.sailing.polars/src/com/sap/sailing/polars/jaxrs/client/FileBasedPolarDataClient.java
| ... | ... | @@ -0,0 +1,28 @@ |
| 1 | +package com.sap.sailing.polars.jaxrs.client; |
|
| 2 | + |
|
| 3 | +import java.io.File; |
|
| 4 | +import java.io.FileInputStream; |
|
| 5 | +import java.io.IOException; |
|
| 6 | +import java.io.InputStream; |
|
| 7 | +import java.util.Optional; |
|
| 8 | + |
|
| 9 | +import org.json.simple.parser.ParseException; |
|
| 10 | + |
|
| 11 | +import com.sap.sailing.domain.base.DomainFactory; |
|
| 12 | +import com.sap.sailing.polars.ReplicablePolarService; |
|
| 13 | + |
|
| 14 | +public class FileBasedPolarDataClient extends PolarDataClient { |
|
| 15 | + |
|
| 16 | + private final File file; |
|
| 17 | + |
|
| 18 | + public FileBasedPolarDataClient(File file, ReplicablePolarService polarService, DomainFactory domainFactory) { |
|
| 19 | + super(null, polarService, Optional.empty()); |
|
| 20 | + polarService.registerDomainFactory(domainFactory); |
|
| 21 | + this.file = file; |
|
| 22 | + } |
|
| 23 | + |
|
| 24 | + @Override |
|
| 25 | + protected InputStream getContentFromResponse() throws IOException, ParseException { |
|
| 26 | + return new FileInputStream(file); |
|
| 27 | + } |
|
| 28 | +} |
java/com.sap.sailing.server/SailingServer (No Proxy).launch
| ... | ... | @@ -24,7 +24,7 @@ |
| 24 | 24 | <stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> |
| 25 | 25 | <stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -console 12001 -clean"/> |
| 26 | 26 | <stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/> |
| 27 | - <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea -Declipse.ignoreApp=true -Dosgi.noShutdown=true -Dfile.encoding=cp1252 -Dexpedition.udp.port=5010 -Xmx6000m -XX:ThreadPriorityPolicy=2 -XX:+UseG1GC -Djetty.home=${project_loc:com.sap.sailing.server}/../target/configuration/jetty -Djava.util.logging.config.file=${project_loc:com.sap.sailing.server}/../target/configuration/logging_debug.properties -Dkiwo.results=${project_loc:com.sap.sailing.kiworesultimport.test}/resources -Dpersistentcompetitors.clear=false -Dpolardata.source.url=https://www.sapsailing.com -Dwindestimation.source.url=https://www.sapsailing.com -Drestore.tracked.races=true -Dorg.eclipse.jetty.server.Request.maxFormContentSize=50000000 -DAnniversaryRaceDeterminator.enabled=true -Djava.naming.factory.url.pkgs=org.eclipse.jetty.jndi -Djava.naming.factory.initial=org.eclipse.jetty.jndi.InitialContextFactory -Dorg.eclipse.jetty.annotations.maxWait=120 -Dchargebee.site=${CHARGEBEE_SITE} -Dchargebee.apikey=${CHARGEBEE_API_KEY} -Dmanage2sail.accesstoken=${MANAGE2SAIL_ACCESS_TOKEN} -Dsubscriptions.disableMailVerificationRequirement=true -Dgoogle.maps.authenticationparams=${GOOGLE_MAPS_AUTHENTICATION_PARAMS} -Dgwt.rpc.version=9 -Dwindestimation.source.bearertoken=${WIND_ESTIMATION_MODEL_BEARER_TOKEN} -Dpolardata.source.bearertoken=${POLAR_DATA_BEARER_TOKEN} -Dcom.sap.sse.branding=SAP -Digtimi.riot.port=6000 -Digtimi.base.url=http://127.0.0.1:8888 -Dsap.aicore.credentials='${SAP_AICORE_CREDENTIALS}' -Dsap.sailing.aiagent.modelname=gpt-4o -Dgeonames.org.usernames="${GEONAMES_ORG_USERNAMES}""/> |
|
| 27 | + <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea -Declipse.ignoreApp=true -Dosgi.noShutdown=true -Dfile.encoding=cp1252 -Dexpedition.udp.port=5010 -Xmx12g -XX:ThreadPriorityPolicy=2 -XX:+UseG1GC -Djetty.home=${project_loc:com.sap.sailing.server}/../target/configuration/jetty -Djava.util.logging.config.file=${project_loc:com.sap.sailing.server}/../target/configuration/logging_debug.properties -Dkiwo.results=${project_loc:com.sap.sailing.kiworesultimport.test}/resources -Dpersistentcompetitors.clear=false -Dpolardata.source.url=https://www.sapsailing.com -Dwindestimation.source.url=https://www.sapsailing.com -Drestore.tracked.races=true -Dorg.eclipse.jetty.server.Request.maxFormContentSize=50000000 -DAnniversaryRaceDeterminator.enabled=true -Djava.naming.factory.url.pkgs=org.eclipse.jetty.jndi -Djava.naming.factory.initial=org.eclipse.jetty.jndi.InitialContextFactory -Dorg.eclipse.jetty.annotations.maxWait=120 -Dchargebee.site=${CHARGEBEE_SITE} -Dchargebee.apikey=${CHARGEBEE_API_KEY} -Dmanage2sail.accesstoken=${MANAGE2SAIL_ACCESS_TOKEN} -Dsubscriptions.disableMailVerificationRequirement=true -Dgoogle.maps.authenticationparams=${GOOGLE_MAPS_AUTHENTICATION_PARAMS} -Dgwt.rpc.version=9 -Dwindestimation.source.bearertoken=${WIND_ESTIMATION_MODEL_BEARER_TOKEN} -Dpolardata.source.bearertoken=${POLAR_DATA_BEARER_TOKEN} -Dcom.sap.sse.branding=SAP -Digtimi.riot.port=6000 -Digtimi.base.url=http://127.0.0.1:8888 -Dsap.aicore.credentials='${SAP_AICORE_CREDENTIALS}' -Dsap.sailing.aiagent.modelname=gpt-4o -Dgeonames.org.usernames="${GEONAMES_ORG_USERNAMES}""/> |
|
| 28 | 28 | <stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc}"/> |
| 29 | 29 | <stringAttribute key="pde.version" value="3.3"/> |
| 30 | 30 | <stringAttribute key="profilingTraceType-ALLOCATION_TRACE" value="KEY_APPLICATION_FILTER%CTX_KEY%*%CTX_ENTRY%INCREASE_COUNT%CTX_KEY%8192%CTX_ENTRY%KEY_MIN_SIZE%CTX_KEY%32%CTX_ENTRY%KEY_MAX_SIZE%CTX_KEY%65536%CTX_ENTRY%KEY_INC_LINE_NRS%CTX_KEY%true%CTX_ENTRY%KEY_SESSION_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_ENABLEMENT%CTX_KEY%false%CTX_ENTRY%CLASS_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_USER_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_REQUEST_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_TENANT_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_ADAPTIVE%CTX_KEY%false%CTX_ENTRY%"/> |
java/com.sap.sailing.windestimation.test/resources/polar_data
| ... | ... | Binary files /dev/null and b/java/com.sap.sailing.windestimation.test/resources/polar_data differ |
java/com.sap.sailing.windestimation.test/src/com/sap/sailing/windestimation/integration/AbstractTestWithLocal505PolarData.java
| ... | ... | @@ -0,0 +1,30 @@ |
| 1 | +package com.sap.sailing.windestimation.integration; |
|
| 2 | + |
|
| 3 | +import java.io.File; |
|
| 4 | +import java.io.IOException; |
|
| 5 | +import java.net.MalformedURLException; |
|
| 6 | +import java.net.URISyntaxException; |
|
| 7 | + |
|
| 8 | +import org.json.simple.parser.ParseException; |
|
| 9 | + |
|
| 10 | +import com.sap.sailing.domain.base.DomainFactory; |
|
| 11 | +import com.sap.sailing.domain.polars.PolarDataService; |
|
| 12 | +import com.sap.sailing.domain.test.OnlineTracTracBasedTest; |
|
| 13 | +import com.sap.sailing.polars.impl.PolarDataServiceImpl; |
|
| 14 | +import com.sap.sailing.polars.jaxrs.client.FileBasedPolarDataClient; |
|
| 15 | + |
|
| 16 | +public abstract class AbstractTestWithLocal505PolarData extends OnlineTracTracBasedTest { |
|
| 17 | + protected AbstractTestWithLocal505PolarData() throws MalformedURLException, URISyntaxException { |
|
| 18 | + super(); |
|
| 19 | + } |
|
| 20 | + |
|
| 21 | + protected PolarDataService createPolarDataService() throws ClassNotFoundException, IOException, ParseException, InterruptedException { |
|
| 22 | + final PolarDataServiceImpl polarDataService = new PolarDataServiceImpl(); |
|
| 23 | + final com.sap.sailing.domain.tractracadapter.DomainFactory domainFactoryImpl = getDomainFactory(); |
|
| 24 | + final DomainFactory baseDomainFactory = domainFactoryImpl.getBaseDomainFactory(); |
|
| 25 | + final FileBasedPolarDataClient client = new FileBasedPolarDataClient(new File("resources/polar_data"), polarDataService, baseDomainFactory); |
|
| 26 | + client.updatePolarDataRegressions(); |
|
| 27 | + getTrackedRace().setPolarDataService(polarDataService); |
|
| 28 | + return polarDataService; |
|
| 29 | + } |
|
| 30 | +} |
java/com.sap.sailing.windestimation.test/src/com/sap/sailing/windestimation/integration/IncrementalMstHmmWindEstimationForTrackedRaceTest.java
| ... | ... | @@ -45,7 +45,7 @@ import com.sap.sailing.domain.tractracadapter.ReceiverType; |
| 45 | 45 | import com.sap.sailing.domain.windestimation.IncrementalWindEstimation; |
| 46 | 46 | import com.sap.sailing.domain.windestimation.TimePointAndPositionWithToleranceComparator; |
| 47 | 47 | import com.sap.sailing.polars.impl.PolarDataServiceImpl; |
| 48 | -import com.sap.sailing.polars.jaxrs.client.PolarDataClient; |
|
| 48 | +import com.sap.sailing.polars.jaxrs.client.FileBasedPolarDataClient; |
|
| 49 | 49 | import com.sap.sailing.windestimation.ManeuverBasedWindEstimationComponentImpl; |
| 50 | 50 | import com.sap.sailing.windestimation.aggregator.ManeuverClassificationsAggregatorFactory; |
| 51 | 51 | import com.sap.sailing.windestimation.data.CompetitorTrackWithEstimationData; |
| ... | ... | @@ -79,7 +79,7 @@ import com.sap.sse.testutils.MeasurementXMLFile; |
| 79 | 79 | * @author Vladislav Chumak (D069712) |
| 80 | 80 | * |
| 81 | 81 | */ |
| 82 | -public class IncrementalMstHmmWindEstimationForTrackedRaceTest extends OnlineTracTracBasedTest { |
|
| 82 | +public class IncrementalMstHmmWindEstimationForTrackedRaceTest extends AbstractTestWithLocal505PolarData { |
|
| 83 | 83 | private static final Logger logger = Logger.getLogger(IncrementalMstHmmWindEstimationForTrackedRaceTest.class.getName()); |
| 84 | 84 | |
| 85 | 85 | |
| ... | ... | @@ -131,30 +131,11 @@ public class IncrementalMstHmmWindEstimationForTrackedRaceTest extends OnlineTra |
| 131 | 131 | new URL("file:///" + new File("resources/event_20110609_KielerWoch-505_Race_2.txt").getCanonicalPath()), |
| 132 | 132 | /* liveUri */ null, /* storedUri */ storedUri, |
| 133 | 133 | new ReceiverType[] { ReceiverType.MARKPASSINGS, ReceiverType.RACECOURSE, ReceiverType.RAWPOSITIONS, ReceiverType.MARKPOSITIONS }); |
| 134 | - String polarDataBearerToken = System.getProperty("polardata.source.bearertoken"); |
|
| 135 | - if (polarDataBearerToken == null) { |
|
| 136 | - logger.info("Couldn't find polardata.source.bearertoken system property, trying environment variable POLAR_DATA_BEARER_TOKEN"); |
|
| 137 | - polarDataBearerToken = System.getenv("POLAR_DATA_BEARER_TOKEN"); |
|
| 138 | - if (polarDataBearerToken == null) { |
|
| 139 | - logger.warning("Couldn't find POLAR_DATA_BEARER_TOKEN environment variable either, polar data service will not be available"); |
|
| 140 | - } else { |
|
| 141 | - logger.info("Found POLAR_DATA_BEARER_TOKEN environment variable, length "+polarDataBearerToken.length() |
|
| 142 | - +"; polar data service will be available"); |
|
| 143 | - } |
|
| 144 | - } else { |
|
| 145 | - logger.info("Found polardata.source.bearertoken system property, polar data service will be available"); |
|
| 146 | - } |
|
| 147 | - final Optional<String> polardataBearerTokenOptional = Optional.ofNullable(polarDataBearerToken); |
|
| 148 | - if (polardataBearerTokenOptional.isPresent()) { |
|
| 149 | - polarDataService = new PolarDataServiceImpl(); |
|
| 150 | - final com.sap.sailing.domain.tractracadapter.DomainFactory domainFactoryImpl = getDomainFactory(); |
|
| 151 | - final DomainFactory baseDomainFactory = domainFactoryImpl.getBaseDomainFactory(); |
|
| 152 | - polarDataService.registerDomainFactory(baseDomainFactory); |
|
| 153 | - new PolarDataClient(Optional.ofNullable(System.getenv("POLAR_DATA_BASE_URL")).orElse("https://sapsailing.com"), polarDataService, polardataBearerTokenOptional) |
|
| 154 | - .updatePolarDataRegressions(); |
|
| 155 | - } else { |
|
| 156 | - polarDataService = new PolarDataServiceImpl(); |
|
| 157 | - } |
|
| 134 | + polarDataService = new PolarDataServiceImpl(); |
|
| 135 | + final com.sap.sailing.domain.tractracadapter.DomainFactory domainFactoryImpl = getDomainFactory(); |
|
| 136 | + final DomainFactory baseDomainFactory = domainFactoryImpl.getBaseDomainFactory(); |
|
| 137 | + final FileBasedPolarDataClient client = new FileBasedPolarDataClient(new File("resources/polar_data"), polarDataService, baseDomainFactory); |
|
| 138 | + client.updatePolarDataRegressions(); |
|
| 158 | 139 | getTrackedRace().setPolarDataService(polarDataService); |
| 159 | 140 | final GregorianCalendar cal = new GregorianCalendar(2011, 05, 23, 13, 40); |
| 160 | 141 | cal.setTimeZone(TimeZone.getTimeZone("UTC")); |
java/com.sap.sailing.windestimation.test/src/com/sap/sailing/windestimation/integration/IncrementalMstManeuverGraphGeneratorTest.java
| ... | ... | @@ -13,29 +13,24 @@ import java.text.SimpleDateFormat; |
| 13 | 13 | import java.util.ArrayList; |
| 14 | 14 | import java.util.GregorianCalendar; |
| 15 | 15 | import java.util.List; |
| 16 | -import java.util.Optional; |
|
| 17 | 16 | import java.util.Set; |
| 18 | 17 | import java.util.TimeZone; |
| 19 | 18 | import java.util.TreeSet; |
| 20 | -import java.util.logging.Logger; |
|
| 21 | 19 | |
| 22 | 20 | import org.json.simple.parser.ParseException; |
| 23 | 21 | import org.junit.jupiter.api.BeforeEach; |
| 24 | 22 | import org.junit.jupiter.api.Test; |
| 25 | 23 | |
| 26 | 24 | import com.sap.sailing.domain.base.Competitor; |
| 27 | -import com.sap.sailing.domain.base.DomainFactory; |
|
| 28 | 25 | import com.sap.sailing.domain.maneuverdetection.TrackTimeInfo; |
| 29 | 26 | import com.sap.sailing.domain.maneuverdetection.impl.IncrementalManeuverDetectorImpl; |
| 30 | 27 | import com.sap.sailing.domain.maneuverdetection.impl.ManeuverDetectorWithEstimationDataSupportDecoratorImpl; |
| 28 | +import com.sap.sailing.domain.polars.PolarDataService; |
|
| 31 | 29 | import com.sap.sailing.domain.test.OnlineTracTracBasedTest; |
| 32 | 30 | import com.sap.sailing.domain.tracking.CompleteManeuverCurve; |
| 33 | 31 | import com.sap.sailing.domain.tracking.impl.DynamicTrackedRaceImpl; |
| 34 | 32 | import com.sap.sailing.domain.tractracadapter.ReceiverType; |
| 35 | 33 | import com.sap.sailing.domain.windestimation.TimePointAndPositionWithToleranceComparator; |
| 36 | -import com.sap.sailing.polars.ReplicablePolarService; |
|
| 37 | -import com.sap.sailing.polars.impl.PolarDataServiceImpl; |
|
| 38 | -import com.sap.sailing.polars.jaxrs.client.PolarDataClient; |
|
| 39 | 34 | import com.sap.sailing.windestimation.aggregator.msthmm.DistanceAndDurationAwareWindTransitionProbabilitiesCalculator; |
| 40 | 35 | import com.sap.sailing.windestimation.aggregator.msthmm.MstGraphLevel; |
| 41 | 36 | import com.sap.sailing.windestimation.aggregator.msthmm.MstManeuverGraphGenerator.MstManeuverGraphComponents; |
| ... | ... | @@ -55,9 +50,7 @@ import com.sap.sse.common.impl.MillisecondsTimePoint; |
| 55 | 50 | * @author Vladislav Chumak (D069712) |
| 56 | 51 | * |
| 57 | 52 | */ |
| 58 | -public class IncrementalMstManeuverGraphGeneratorTest extends OnlineTracTracBasedTest { |
|
| 59 | - private static final Logger logger = Logger.getLogger(IncrementalMstManeuverGraphGeneratorTest.class.getName()); |
|
| 60 | - |
|
| 53 | +public class IncrementalMstManeuverGraphGeneratorTest extends AbstractTestWithLocal505PolarData { |
|
| 61 | 54 | protected final SimpleDateFormat dateFormat; |
| 62 | 55 | private ClassPathReadOnlyModelStoreImpl modelStore; |
| 63 | 56 | |
| ... | ... | @@ -94,32 +87,7 @@ public class IncrementalMstManeuverGraphGeneratorTest extends OnlineTracTracBase |
| 94 | 87 | assertTrue(gaussianBasedTwdTransitionDistributionCache.isReady() && maneuverClassifiersCache.isReady(), |
| 95 | 88 | "Wind estimation models are empty"); |
| 96 | 89 | final DynamicTrackedRaceImpl trackedRace = getTrackedRace(); |
| 97 | - final ReplicablePolarService polarDataService; |
|
| 98 | - String polarDataBearerToken = System.getProperty("polardata.source.bearertoken"); |
|
| 99 | - if (polarDataBearerToken == null) { |
|
| 100 | - logger.info("Couldn't find polardata.source.bearertoken system property, trying environment variable POLAR_DATA_BEARER_TOKEN"); |
|
| 101 | - polarDataBearerToken = System.getenv("POLAR_DATA_BEARER_TOKEN"); |
|
| 102 | - if (polarDataBearerToken == null) { |
|
| 103 | - logger.warning("Couldn't find POLAR_DATA_BEARER_TOKEN environment variable either, polar data service will not be available"); |
|
| 104 | - } else { |
|
| 105 | - logger.info("Found POLAR_DATA_BEARER_TOKEN environment variable, length "+polarDataBearerToken.length() |
|
| 106 | - +"; polar data service will be available"); |
|
| 107 | - } |
|
| 108 | - } else { |
|
| 109 | - logger.info("Found polardata.source.bearertoken system property, polar data service will be available"); |
|
| 110 | - } |
|
| 111 | - final Optional<String> polardataBearerTokenOptional = Optional.ofNullable(polarDataBearerToken); |
|
| 112 | - if (polardataBearerTokenOptional.isPresent()) { |
|
| 113 | - polarDataService = new PolarDataServiceImpl(); |
|
| 114 | - final com.sap.sailing.domain.tractracadapter.DomainFactory domainFactoryImpl = getDomainFactory(); |
|
| 115 | - final DomainFactory baseDomainFactory = domainFactoryImpl.getBaseDomainFactory(); |
|
| 116 | - polarDataService.registerDomainFactory(baseDomainFactory); |
|
| 117 | - new PolarDataClient( |
|
| 118 | - Optional.ofNullable(System.getenv("POLAR_DATA_BASE_URL")).orElse("https://sapsailing.com"), |
|
| 119 | - polarDataService, polardataBearerTokenOptional).updatePolarDataRegressions(); |
|
| 120 | - } else { |
|
| 121 | - polarDataService = null; |
|
| 122 | - } |
|
| 90 | + final PolarDataService polarDataService = createPolarDataService(); |
|
| 123 | 91 | final IncrementalMstManeuverGraphGenerator generator = new IncrementalMstManeuverGraphGenerator( |
| 124 | 92 | new CompleteManeuverCurveToManeuverForEstimationConverter(trackedRace, polarDataService), |
| 125 | 93 | transitionProbabilitiesCalculator, maneuverClassifiersCache); |