mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-08 21:30:57 +00:00
Merge remote-tracking branch 'origin/master' into tp_cleanup2
This commit is contained in:
commit
17d0f286b2
3 files changed
+2
-10
No files matched your search
-8
@@ -47,14 +47,6 @@ public class DomainFactoryTest {
|
||||
assertThat(raceType.getRaceCode(), is(OlympicRaceCode._470_WOMEN));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGet470WomenBoatClass2() throws Exception {
|
||||
String raceID = "SAW005_xxx";
|
||||
RaceType raceType = swissTimingDomainFactory.getRaceTypeFromRaceID(raceID );
|
||||
assertThat(raceType, is(notNullValue()));
|
||||
assertThat(raceType.getRaceCode(), is(OlympicRaceCode._470_WOMEN));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDontGetWrongBoatClass() throws Exception {
|
||||
String raceID = "ABC";
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ public class SimpleDomainFactoryTest {
|
||||
|
||||
@Test
|
||||
public void testExtractBoatClassFromRaceIDWithEventID() {
|
||||
String raceID = "QINSWC12013;SAW005901";
|
||||
String raceID = "QINSWC12013_SAW005901";
|
||||
RaceType raceType = DomainFactory.INSTANCE.getRaceTypeFromRaceID(raceID);
|
||||
assertEquals("470", raceType.getBoatClass().getName());
|
||||
}
|
||||
|
||||
+1
-1
@@ -206,7 +206,7 @@ public class DomainFactoryImpl implements DomainFactory {
|
||||
public RaceType getRaceTypeFromRaceID(String raceID) {
|
||||
final RaceType result;
|
||||
if (raceID != null && raceID.length() >= 6) {
|
||||
final String[] optionalEventIDAndMandatoryRaceID = raceID.split(";");
|
||||
final String[] optionalEventIDAndMandatoryRaceID = raceID.split("_");
|
||||
final String swissTimingRaceCode = optionalEventIDAndMandatoryRaceID[optionalEventIDAndMandatoryRaceID.length-1].substring(0, 6).toUpperCase();
|
||||
RaceType raceType = raceTypeByID.get(swissTimingRaceCode);
|
||||
if (raceType == null) {
|
||||
|
||||
Reference in new issue
Block a user