bug6127: first step migrating tests from JUnit4 to JUnit5

This commit is contained in:
Axel Uhl
2025-06-05 17:21:25 +02:00
parent 8f9e9619e4
commit faf71f55a7
753 changed files with 4627 additions and 4622 deletions
@@ -1,10 +1,10 @@
package com.sap.sailing.barbados.resultimport.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.File;
import java.io.FileInputStream;
@@ -18,8 +18,8 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.sap.sailing.barbados.resultimport.impl.BarbadosResultSpreadsheet;
import com.sap.sailing.barbados.resultimport.impl.ScoreCorrectionProviderImpl;
@@ -50,7 +50,7 @@ public class BarbadosResultImportTest {
return new File(RESOURCES + filename);
}
@Before
@BeforeEach
public void setUp() throws FileNotFoundException, IOException, Exception {
spreadsheet = new BarbadosResultSpreadsheet(getInputStream(SAMPLE_INPUT_NAME_EMPTY_RESULTS));
scp = new ScoreCorrectionProviderImpl(new ResultDocumentProvider() {
@@ -31,8 +31,8 @@ import org.apache.shiro.subject.SimplePrincipalCollection;
import org.apache.shiro.subject.Subject;
import org.apache.shiro.util.ThreadContext;
import org.apache.shiro.web.subject.support.WebDelegatingSubject;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.sap.sailing.datamining.data.HasLeaderboardGroupContext;
import com.sap.sailing.datamining.test.util.ConcurrencyTestsUtil;
@@ -104,7 +104,7 @@ public class TestLeaderboardGroupRetrievalProcessor {
}
}
@Before
@BeforeEach
public void initializeComponents() {
final DummyRealm realm = new DummyRealm();
SecurityUtils.setSecurityManager(new DefaultSecurityManager(realm));
@@ -1,16 +1,16 @@
package com.sap.sailing.datamining.impl.components;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.sap.sailing.datamining.data.HasLeaderboardContext;
import com.sap.sailing.datamining.data.HasRaceOfCompetitorContext;
@@ -54,7 +54,7 @@ public class TestSegmentsTackType extends StoredTrackBasedTest {
private HasRaceOfCompetitorContext raceOfCompContext;
private TackTypeSegmentRetrievalProcessor resultTTSegmentsRetrieval;
@Before
@BeforeEach
public void setup() {
competitorA = createCompetitorWithBoat("A");
trackedRace = createTestTrackedRace("TestRegatta", "TestRace", "F18", createCompetitorAndBoatsMap(competitorA),
@@ -8,8 +8,8 @@ import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.sap.sailing.datamining.Activator;
import com.sap.sailing.datamining.data.HasGPSFixContext;
@@ -30,7 +30,7 @@ public class TestSailingFunctionsRegistration {
private OpenFunctionManager functionRegistry;
@Before
@BeforeEach
public void setUpFunctionRegistryAndProvider() {
functionRegistry = new OpenFunctionManager();
functionRegistry.registerAllClasses(Activator.getDefault().getClassesWithMarkedMethods());
@@ -1,6 +1,6 @@
package com.sap.sailing.datamining.test.util;
import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.fail;
import java.util.concurrent.ExecutorService;
@@ -1,11 +1,11 @@
package com.sap.sailing.datamining.test.util;
import static org.junit.Assert.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import java.io.IOException;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import net.bytebuddy.agent.VirtualMachine;
@@ -15,7 +15,7 @@ import net.bytebuddy.agent.VirtualMachine;
* @author Axel Uhl (d043530)
*
*/
@Ignore("This class is used only to demonstrate how injecting the JMX Prometheus Java agent works for a running VM")
@Disabled("This class is used only to demonstrate how injecting the JMX Prometheus Java agent works for a running VM")
public class TestAttachToVM {
@Test
public void testInjectAgentToRunningVM() throws IOException {
@@ -1,11 +1,11 @@
package com.sap.sailing.declination.test;
import org.junit.Before;
import org.junit.jupiter.api.BeforeEach;
import com.sap.sailing.declination.impl.BGSImporter;
public class BGSDeclinationImportTest extends DeclinationImportTest<BGSImporter> {
@Before
@BeforeEach
public void setUp() {
importer = new BGSImporter();
}
@@ -1,13 +1,13 @@
package com.sap.sailing.declination.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import java.io.IOException;
import java.text.ParseException;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.sap.sailing.declination.Declination;
import com.sap.sailing.declination.impl.BGSImporter;
@@ -16,7 +16,7 @@ import com.sap.sse.common.impl.MillisecondsTimePoint;
public class BGSDeclinationServiceTest extends DeclinationServiceTest<BGSImporter> {
@Override
@Before
@BeforeEach
public void setUp() {
importer = new BGSImporter();
super.setUp();
@@ -1,12 +1,12 @@
package com.sap.sailing.declination.test;
import org.junit.Before;
import org.junit.jupiter.api.BeforeEach;
import com.sap.sailing.declination.impl.BGSImporter;
public class BGSDeclinationStoreTest extends DeclinationStoreTest<BGSImporter> {
@Override
@Before
@BeforeEach
public void setUp() {
importer = new BGSImporter();
super.setUp();
@@ -1,11 +1,11 @@
package com.sap.sailing.declination.test;
import org.junit.Before;
import org.junit.jupiter.api.BeforeEach;
import com.sap.sailing.declination.impl.BGSImporter;
public class BGSSimpleDeclinationTest extends SimpleDeclinationTest<BGSImporter> {
@Before
@BeforeEach
public void setUp() {
importer = new BGSImporter();
}
@@ -1,13 +1,13 @@
package com.sap.sailing.declination.test;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import com.sap.sailing.declination.impl.ColoradoImporter;
@Ignore("currently, http://magcalc.geomag.info/ seems down")
@Disabled("currently, http://magcalc.geomag.info/ seems down")
public class ColoradoDeclinationImportTest extends DeclinationImportTest<ColoradoImporter> {
@Before
@BeforeEach
public void setUp() {
importer = new ColoradoImporter();
}
@@ -1,24 +1,24 @@
package com.sap.sailing.declination.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import java.io.IOException;
import java.text.ParseException;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import com.sap.sailing.declination.Declination;
import com.sap.sailing.declination.impl.ColoradoImporter;
import com.sap.sailing.domain.common.impl.DegreePosition;
import com.sap.sse.common.impl.MillisecondsTimePoint;
@Ignore("currently, http://magcalc.geomag.info/ seems down")
@Disabled("currently, http://magcalc.geomag.info/ seems down")
public class ColoradoDeclinationServiceTest extends DeclinationServiceTest<ColoradoImporter> {
@Override
@Before
@BeforeEach
public void setUp() {
importer = new ColoradoImporter();
super.setUp();
@@ -1,14 +1,14 @@
package com.sap.sailing.declination.test;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import com.sap.sailing.declination.impl.ColoradoImporter;
@Ignore("currently, http://magcalc.geomag.info/ seems down")
@Disabled("currently, http://magcalc.geomag.info/ seems down")
public class ColoradoDeclinationStoreTest extends DeclinationStoreTest<ColoradoImporter> {
@Override
@Before
@BeforeEach
public void setUp() {
importer = new ColoradoImporter();
super.setUp();
@@ -1,13 +1,13 @@
package com.sap.sailing.declination.test;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import com.sap.sailing.declination.impl.ColoradoImporter;
@Ignore("currently, http://magcalc.geomag.info/ seems down")
@Disabled("currently, http://magcalc.geomag.info/ seems down")
public class ColoradoSimpleDeclinationTest extends SimpleDeclinationTest<ColoradoImporter> {
@Before
@BeforeEach
public void setUp() {
importer = new ColoradoImporter();
}
@@ -1,6 +1,6 @@
package com.sap.sailing.declination.test;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.io.IOException;
import java.text.ParseException;
@@ -9,8 +9,8 @@ import java.util.TimeZone;
import javax.xml.parsers.ParserConfigurationException;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.xml.sax.SAXException;
import com.sap.sailing.declination.Declination;
@@ -18,7 +18,7 @@ import com.sap.sailing.declination.impl.ColoradoImporter;
import com.sap.sailing.domain.common.impl.DegreePosition;
import com.sap.sse.common.impl.MillisecondsTimePoint;
@Ignore("currently, http://magcalc.geomag.info/ seems down")
@Disabled("currently, http://magcalc.geomag.info/ seems down")
public class ColoradoTest {
@Test
public void simpleDocumentParsingTest() throws SAXException, IOException, ParserConfigurationException {
@@ -1,14 +1,14 @@
package com.sap.sailing.declination.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import java.io.IOException;
import java.text.ParseException;
import javax.xml.parsers.ParserConfigurationException;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.xml.sax.SAXException;
import com.sap.sailing.declination.Declination;
@@ -1,14 +1,14 @@
package com.sap.sailing.declination.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import java.io.IOException;
import java.text.ParseException;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.sap.sailing.declination.Declination;
import com.sap.sailing.declination.DeclinationService;
@@ -21,7 +21,7 @@ import com.sap.sse.common.impl.MillisecondsTimePoint;
public abstract class DeclinationServiceTest<I extends DeclinationImporter> extends AbstractDeclinationTest<I> {
protected DeclinationService service;
@Before
@BeforeEach
public void setUp() {
service = new DeclinationServiceImpl(new CentralAngleDistance(1./180.*Math.PI), importer);
}
@@ -1,10 +1,10 @@
package com.sap.sailing.declination.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -23,9 +23,9 @@ import java.io.Writer;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import com.sap.sailing.declination.Declination;
import com.sap.sailing.declination.impl.DeclinationImporter;
@@ -43,7 +43,7 @@ public abstract class DeclinationStoreTest<I extends DeclinationImporter> extend
private DeclinationStore store;
private static final SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd");
@Before
@BeforeEach
public void setUp() {
store = new DeclinationStore(importer);
}
@@ -322,7 +322,7 @@ public abstract class DeclinationStoreTest<I extends DeclinationImporter> extend
}
}
@Ignore("This was a one-time-only conversion")
@Disabled("This was a one-time-only conversion")
@Test
public void copyExistingDeclinationsToNewFormat() throws IOException, ClassNotFoundException, ParseException {
File resourcesDir = new File("../com.sap.sailing.declination/resources/");
@@ -1,11 +1,11 @@
package com.sap.sailing.declination.test;
import org.junit.Before;
import org.junit.jupiter.api.BeforeEach;
import com.sap.sailing.declination.impl.NOAAImporterForTesting;
public class NOAADeclinationImportTest extends DeclinationImportTest<NOAAImporterForTesting> {
@Before
@BeforeEach
public void setUp() {
importer = new NOAAImporterForTesting();
}
@@ -1,12 +1,12 @@
package com.sap.sailing.declination.test;
import org.junit.Before;
import org.junit.jupiter.api.BeforeEach;
import com.sap.sailing.declination.impl.NOAAImporter;
public class NOAADeclinationServiceTest extends DeclinationServiceTest<NOAAImporter> {
@Override
@Before
@BeforeEach
public void setUp() {
importer = new NOAAImporter();
super.setUp();
@@ -1,12 +1,12 @@
package com.sap.sailing.declination.test;
import org.junit.Before;
import org.junit.jupiter.api.BeforeEach;
import com.sap.sailing.declination.impl.NOAAImporter;
public class NOAADeclinationStoreTest extends DeclinationStoreTest<NOAAImporter> {
@Override
@Before
@BeforeEach
public void setUp() {
importer = new NOAAImporter();
super.setUp();
@@ -1,17 +1,17 @@
package com.sap.sailing.declination.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.regex.Matcher;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.sap.sailing.declination.impl.NOAAImporterForTesting;
public class NOAARegexpTest extends AbstractDeclinationTest<NOAAImporterForTesting> {
@Before
@BeforeEach
public void setUp() {
importer = new NOAAImporterForTesting();
}
@@ -1,11 +1,11 @@
package com.sap.sailing.declination.test;
import org.junit.Before;
import org.junit.jupiter.api.BeforeEach;
import com.sap.sailing.declination.impl.NOAAImporter;
public class NOAASimpleDeclinationTest extends SimpleDeclinationTest<NOAAImporter> {
@Before
@BeforeEach
public void setUp() {
importer = new NOAAImporter();
}
@@ -1,13 +1,13 @@
package com.sap.sailing.declination.test;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.io.IOException;
import java.text.ParseException;
import javax.xml.parsers.ParserConfigurationException;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.xml.sax.SAXException;
import com.sap.sailing.declination.Declination;
@@ -1,7 +1,7 @@
package com.sap.sailing.domain.deckmanadapter.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import java.io.IOException;
import java.io.InputStreamReader;
@@ -11,7 +11,7 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Iterator;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.common.Position;
import com.sap.sailing.domain.common.Wind;
@@ -1,9 +1,9 @@
package com.sap.sailing.domain.igtimiadapter.persistence;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.net.InetSocketAddress;
import java.util.Arrays;
@@ -12,9 +12,9 @@ import java.util.Iterator;
import java.util.Set;
import java.util.logging.Logger;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.igtimi.IgtimiData.ApparentWindSpeed;
import com.igtimi.IgtimiData.Data;
@@ -45,14 +45,14 @@ public class IgtimiPersistenceTest {
private MongoObjectFactory mongoObjectFactory;
private DomainObjectFactory domainObjectFactory;
@BeforeClass
@BeforeAll
public static void setUpClientSession() {
testDBConfig = MongoDBConfiguration.getDefaultTestConfiguration();
mongoDBService = testDBConfig.getService();
clientSession = mongoDBService.startCausallyConsistentSession();
}
@Before
@BeforeEach
public void setUp() {
mongoObjectFactory = PersistenceFactory.INSTANCE.getMongoObjectFactory(mongoDBService);
mongoObjectFactory.clear(clientSession);
@@ -1,7 +1,7 @@
package com.sap.sailing.domain.igtimiadapter.impl;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import java.util.ArrayList;
import java.util.Arrays;
@@ -11,7 +11,7 @@ import java.util.Map;
import java.util.Set;
import org.junit.Rule;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.junit.rules.Timeout;
import com.sap.sailing.declination.DeclinationService;
@@ -1,7 +1,7 @@
package com.sap.sailing.domain.igtimiadapter.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.ArrayList;
import java.util.List;
@@ -9,8 +9,8 @@ import java.util.List;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.google.protobuf.InvalidProtocolBufferException;
import com.sap.sailing.domain.igtimiadapter.FixFactory;
@@ -24,7 +24,7 @@ import com.sap.sse.common.Util;
public class FixFactoryTest {
private FixFactory fixFactory;
@Before
@BeforeEach
public void setUp() {
fixFactory = new FixFactory();
}
@@ -1,8 +1,8 @@
package com.sap.sailing.domain.igtimiadapter.test;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.net.URL;
import java.util.ArrayList;
@@ -10,7 +10,7 @@ import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.common.Wind;
import com.sap.sailing.domain.common.impl.KnotSpeedImpl;
@@ -1,13 +1,13 @@
package com.sap.sailing.domain.igtimiadapter.test;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.Iterator;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import com.google.protobuf.InvalidProtocolBufferException;
import com.sap.sailing.domain.igtimiadapter.FixFactory;
@@ -1,6 +1,6 @@
package com.sap.sailing.domain.igtimiadapter.test;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.io.IOException;
import java.io.InputStream;
@@ -15,8 +15,8 @@ import java.util.logging.Logger;
import org.apache.http.client.ClientProtocolException;
import org.json.simple.parser.ParseException;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.igtimi.IgtimiStream.Msg;
import com.sap.sailing.domain.igtimiadapter.FixFactory;
@@ -50,7 +50,7 @@ public class TestRiotServer {
}
}
@Before
@BeforeEach
public void setUp() throws ClientProtocolException, IllegalStateException, IOException, ParseException {
final SecurityService mockSecurityService = SecurityServiceMockFactory.mockSecurityService();
Activator.getInstance().setSecurityService(mockSecurityService);
@@ -1,8 +1,8 @@
package com.sap.sailing.domain.igtimiadapter.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import java.io.BufferedReader;
import java.io.IOException;
@@ -10,7 +10,7 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.logging.Logger;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import com.google.protobuf.CodedInputStream;
import com.google.protobuf.ExtensionRegistry;
@@ -1,7 +1,7 @@
package com.sap.sailing.domain.igtimiadapter.websocket.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.IOException;
import java.net.URI;
@@ -21,7 +21,7 @@ import org.eclipse.jetty.websocket.client.ClientUpgradeRequest;
import org.eclipse.jetty.websocket.client.WebSocketClient;
import org.eclipse.jetty.websocket.servlet.WebSocketServlet;
import org.eclipse.jetty.websocket.servlet.WebSocketServletFactory;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import com.igtimi.IgtimiStream.ChannelManagement;
import com.igtimi.IgtimiStream.Msg;
@@ -2,9 +2,9 @@ package com.sap.sailing.domain.queclinkadapter.impl;
import java.io.IOException;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import com.mongodb.MongoException;
import com.mongodb.ReadConcern;
@@ -26,12 +26,12 @@ public class AbstractQueclinkTrackerTest {
protected SensorFixStore store;
private static ClientSession clientSession;
@BeforeClass
@BeforeAll
public static void setUpClass() {
clientSession = MongoDBService.INSTANCE.startCausallyConsistentSession();
}
@Before
@BeforeEach
public void setUp() throws MongoException, IOException {
dropPersistedData();
newStore();
@@ -43,7 +43,7 @@ public class AbstractQueclinkTrackerTest {
WriteConcern.MAJORITY, clientSession, clientSession);
}
@After
@AfterEach
public void after() throws IOException {
dropPersistedData();
}
@@ -1,9 +1,9 @@
package com.sap.sailing.domain.queclinkadapter.impl;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.IOException;
import java.io.InputStreamReader;
@@ -11,8 +11,8 @@ import java.io.Reader;
import java.text.ParseException;
import java.util.regex.Matcher;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.common.Position;
import com.sap.sailing.domain.common.impl.DegreePosition;
@@ -30,7 +30,7 @@ public class TestQueclinkMessageParser {
private static final double EPSILON = 0.00000001;
private MessageParser messageParser;
@Before
@BeforeEach
public void setUp() {
this.messageParser = MessageParser.create();
}
@@ -71,7 +71,7 @@ public class TestQueclinkMessageParser {
final TimePoint now = TimePoint.now();
final Message ackHBD = new HBDAcknowledgementImpl(MessageParserImpl.parseProtocolVersionHex("301303"), MessageParserImpl.parseCountNumberHex("033E"), "860599004785994", null, now);
final Matcher matcher = MessageParserImpl.messagePattern.matcher(ackHBD.getMessageString());
assertTrue("Pattern "+MessageParserImpl.messagePattern.toString()+" doesn't match "+ackHBD.getMessageString(), matcher.matches());
assertTrue(matcher.matches(), "Pattern "+MessageParserImpl.messagePattern.toString()+" doesn't match "+ackHBD.getMessageString());
assertEquals("+ACK:", matcher.group(1));
assertEquals("HBD", matcher.group(8));
assertEquals("301303,860599004785994,,"+MessageParserImpl.formatAsYYYYMMDDHHMMSS(now)+",033E", matcher.group(9));
@@ -81,7 +81,7 @@ public class TestQueclinkMessageParser {
public void simplePatternTestForSACKHeartbeatMessage() {
final Message sackHBD = new HBDServerAcknowledgementImpl(MessageParserImpl.parseProtocolVersionHex("301303"), MessageParserImpl.parseCountNumberHex("033E"));
final Matcher matcher = MessageParserImpl.messagePattern.matcher(sackHBD.getMessageString());
assertTrue("Pattern "+MessageParserImpl.messagePattern.toString()+" doesn't match "+sackHBD.getMessageString(), matcher.matches());
assertTrue(matcher.matches(), "Pattern "+MessageParserImpl.messagePattern.toString()+" doesn't match "+sackHBD.getMessageString());
assertEquals("+SACK:", matcher.group(1));
assertEquals("HBD", matcher.group(8));
assertEquals("301303,033E", matcher.group(9));
@@ -91,7 +91,7 @@ public class TestQueclinkMessageParser {
public void simplePatternTestForBasicSACKMessage() {
final String sackMessage = "+SACK:11F0$";
final Matcher matcher = MessageParserImpl.messagePattern.matcher(sackMessage);
assertTrue("Pattern "+MessageParserImpl.messagePattern.toString()+" doesn't match "+sackMessage, matcher.matches());
assertTrue(matcher.matches(), "Pattern "+MessageParserImpl.messagePattern.toString()+" doesn't match "+sackMessage);
assertEquals("+SACK:", matcher.group(1));
assertEquals(null, matcher.group(8));
assertEquals("11F0", matcher.group(9));
@@ -1,16 +1,16 @@
package com.sap.sailing.domain.queclinkadapter.impl;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.mongodb.MongoException;
import com.sap.sailing.domain.queclinkadapter.tracker.QueclinkTCPTracker;
@@ -19,14 +19,14 @@ public class TestQueclinkTCPTracker extends AbstractQueclinkTrackerTest {
private QueclinkTCPTracker tracker;
@Override
@Before
@BeforeEach
public void setUp() throws MongoException, IOException {
super.setUp();
tracker = new QueclinkTCPTracker(/* pick a port */ 0, store);
}
@Override
@After
@AfterEach
public void after() throws IOException {
super.after();
tracker.stop();
@@ -1,7 +1,7 @@
package com.sap.sailing.domain.queclinkadapter.impl;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.IOException;
import java.io.InputStream;
@@ -9,9 +9,9 @@ import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetSocketAddress;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.mongodb.MongoException;
import com.sap.sailing.domain.queclinkadapter.tracker.QueclinkUDPTracker;
@@ -20,14 +20,14 @@ public class TestQueclinkUDPTracker extends AbstractQueclinkTrackerTest {
private QueclinkUDPTracker tracker;
@Override
@Before
@BeforeEach
public void setUp() throws MongoException, IOException {
super.setUp();
tracker = new QueclinkUDPTracker(/* pick a port */ 0, store);
}
@Override
@After
@AfterEach
public void after() throws IOException {
super.after();
tracker.stop();
@@ -1,14 +1,14 @@
package com.sap.sailing.domain.racelogtracking.test;
import static com.sap.sse.common.Util.size;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.mock;
import java.util.Collections;
import java.util.UUID;
import org.junit.After;
import org.junit.Before;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import com.mongodb.ReadConcern;
import com.mongodb.WriteConcern;
@@ -81,7 +81,7 @@ public class AbstractGPSFixStoreTest extends RaceLogTrackingTestHelper {
new MillisecondsTimePoint(millis));
}
@Before
@BeforeEach
public void setServiceAndRaceLog() {
service = new RacingEventServiceImpl(null, null, serviceFinderFactory);
raceLog = new RaceLogImpl("racelog");
@@ -93,7 +93,7 @@ public class AbstractGPSFixStoreTest extends RaceLogTrackingTestHelper {
serviceFinderFactory, ReadConcern.MAJORITY, WriteConcern.MAJORITY, clientSession, metadataCollectionClientSession);
}
@After
@AfterEach
public void after() {
dropPersistedData();
clientSession.close();
@@ -1,12 +1,12 @@
package com.sap.sailing.domain.racelogtracking.test;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.UUID;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.mongodb.ReadConcern;
import com.mongodb.WriteConcern;
@@ -44,12 +44,12 @@ public class MetadataUpdaterTest {
return (TypeBasedServiceFinder) serviceFinderFactory.createServiceFinder(FixMongoHandler.class);
}
@BeforeClass
@BeforeAll
public static void createClientSession() {
clientSession = MongoDBService.INSTANCE.startCausallyConsistentSession();
}
@Before
@BeforeEach
public void dropData() {
MongoDatabase db = PersistenceFactory.INSTANCE.getDefaultMongoObjectFactory().getDatabase();
db.getCollection(CollectionNames.GPS_FIXES.name()).withWriteConcern(WriteConcern.MAJORITY).drop(clientSession);
@@ -2,8 +2,9 @@ package com.sap.sailing.domain.racelogtracking.test;
import java.util.UUID;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
@@ -18,14 +19,12 @@ import com.sap.sailing.domain.base.impl.MarkImpl;
import com.sap.sailing.domain.racelogtracking.impl.PingDeviceIdentifierImpl;
import com.sap.sse.common.impl.MillisecondsTimePoint;
import org.junit.Assert;
public class RevokeDeviceMappingsWithMarkDefinitionTest {
private RegattaLog regattaLog;
private AbstractLogEventAuthor author;
private Mark mark;
@Before
@BeforeEach
public void prepare() {
regattaLog = new RegattaLogImpl("RevokeTest");
author = new LogEventAuthorImpl("RevokeTest", 1);
@@ -47,10 +46,10 @@ public class RevokeDeviceMappingsWithMarkDefinitionTest {
for (RegattaLogEvent event : regattaLog.getUnrevokedEvents()) {
if (event instanceof RegattaLogDefineMarkEventImpl) {
Assert.fail("Define mark not revoked.");
Assertions.fail("Define mark not revoked.");
}
if (event instanceof RegattaLogDeviceMarkMappingEventImpl) {
Assert.fail("Device mapping not revoked.");
Assertions.fail("Device mapping not revoked.");
}
}
}
@@ -66,7 +65,7 @@ public class RevokeDeviceMappingsWithMarkDefinitionTest {
for (RegattaLogEvent event : regattaLog.getUnrevokedEvents()) {
if (event instanceof RegattaLogDefineMarkEventImpl) {
Assert.fail("Define mark not revoked.");
Assertions.fail("Define mark not revoked.");
}
}
}
@@ -1,10 +1,10 @@
package com.sap.sailing.domain.racelogtracking.test.impl;
import static com.sap.sse.common.Util.size;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.FileNotFoundException;
import java.io.IOException;
@@ -16,11 +16,11 @@ import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.rules.Timeout;
import com.mongodb.MongoException;
@@ -100,7 +100,7 @@ public class CreateAndTrackWithRaceLogTest extends RaceLogTrackingTestHelper {
@Rule
public Timeout CreateAndTrackWithRaceLogTestTimeout = Timeout.millis(3 * 60 * 1000);
@Before
@BeforeEach
public void setup() throws UnknownHostException, MongoException {
final ClientSession clientSession = MongoDBService.INSTANCE.startCausallyConsistentSession();
final ClientSession metadataCollectionClientSession = MongoDBService.INSTANCE.startCausallyConsistentSession();
@@ -132,7 +132,7 @@ public class CreateAndTrackWithRaceLogTest extends RaceLogTrackingTestHelper {
DomainFactory.INSTANCE.getCompetitorAndBoatStore().clear();
}
@After
@AfterEach
public void tearDown() throws MalformedURLException, IOException, InterruptedException {
service.removeRegatta(regatta);
}
@@ -154,7 +154,7 @@ public class CreateAndTrackWithRaceLogTest extends RaceLogTrackingTestHelper {
public void cantAddBeforeDenoting() throws MalformedURLException, FileNotFoundException, URISyntaxException,
Exception {
RaceColumn column = leaderboard.getRaceColumnByName(columnName);
Assert.assertThrows(NotDenotedForRaceLogTrackingException.class, ()->trackAndGetRace(column));
Assertions.assertThrows(NotDenotedForRaceLogTrackingException.class, ()->trackAndGetRace(column));
}
private void testSize(Track<?> track, int expected) {
@@ -5,7 +5,7 @@ import java.util.Map;
import java.util.concurrent.CyclicBarrier;
import org.junit.Rule;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.junit.rules.Timeout;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
@@ -6,7 +6,7 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import org.junit.Rule;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.junit.rules.Timeout;
import com.sap.sailing.domain.common.DeviceIdentifier;
@@ -10,8 +10,8 @@ import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.mongodb.MongoException;
import com.mongodb.ReadConcern;
@@ -77,7 +77,7 @@ public class RaceLogFixTrackerManagerTest {
protected final AbstractLogEventAuthor author = new LogEventAuthorImpl("author", 0);
private DynamicTrackedRace trackedRace;
@Before
@BeforeEach
public void setUp() throws UnknownHostException, MongoException {
raceLog = new RaceLogImpl("racelog");
raceLog2 = new RaceLogImpl("racelog2");
@@ -1,10 +1,10 @@
package com.sap.sailing.domain.racelogtracking.test.impl;
import static com.sap.sse.common.Util.size;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.mock;
import java.io.Serializable;
@@ -19,9 +19,9 @@ import java.util.Map;
import java.util.UUID;
import java.util.concurrent.CyclicBarrier;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.mongodb.MongoException;
import com.mongodb.ReadConcern;
@@ -141,7 +141,7 @@ public class SensorFixStoreAndLoadTest {
protected final AbstractLogEventAuthor author = new LogEventAuthorImpl("author", 0);
private DynamicTrackedRace trackedRace;
@Before
@BeforeEach
public void setUp() throws UnknownHostException, MongoException {
dropPersistedData();
raceLog = new RaceLogImpl("racelog");
@@ -180,7 +180,7 @@ public class SensorFixStoreAndLoadTest {
db.getCollection(CollectionNames.RACE_LOGS.name()).drop();
}
@After
@AfterEach
public void after() {
dropPersistedData();
}
@@ -1,6 +1,6 @@
package com.sap.sailing.domain.racelogtracking.test.impl;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.ArrayList;
import java.util.List;
@@ -8,11 +8,11 @@ import java.util.Optional;
import java.util.function.Consumer;
import java.util.logging.Level;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import com.mongodb.ReadConcern;
@@ -51,12 +51,12 @@ public class SensorFixStoreTest {
protected SensorFixStore store;
private static ClientSession clientSession;
@BeforeClass
@BeforeAll
public static void setUpClass() {
clientSession = MongoDBService.INSTANCE.startCausallyConsistentSession();
}
@Before
@BeforeEach
public void setUp() throws Exception {
dropPersistedData();
newStore();
@@ -68,7 +68,7 @@ public class SensorFixStoreTest {
WriteConcern.MAJORITY, clientSession, clientSession);
}
@After
@AfterEach
public void after() throws Exception {
store.getNumberOfFixes(device); // wait until all metadata updates have completed;
// this shall avoid that pending updates are written to the metadata collection after
@@ -155,14 +155,14 @@ public class SensorFixStoreTest {
// validate between 0 and 1 (inclusive)
Double last = 0.0;
for (Double progress : progressData) {
Assert.assertTrue(progress <= 1);
Assert.assertTrue(progress >= 0);
Assert.assertTrue(progress >= last);
Assertions.assertTrue(progress <= 1);
Assertions.assertTrue(progress >= 0);
Assertions.assertTrue(progress >= last);
last = progress;
}
//validate that 0-100 updates do exist
Assert.assertFalse(progressData.isEmpty());
Assert.assertTrue(progressData.size() <= 100);
Assertions.assertFalse(progressData.isEmpty());
Assertions.assertTrue(progressData.size() <= 100);
}
@Test
@@ -1,6 +1,6 @@
package com.sap.sailing.domain.racelogtracking.test.impl;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.net.UnknownHostException;
import java.util.ArrayList;
@@ -13,9 +13,9 @@ import java.util.function.Consumer;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.rules.Timeout;
import com.mongodb.MongoException;
@@ -61,7 +61,7 @@ public class TrackedRaceLoadsFixesTest extends AbstractGPSFixStoreTest {
private RaceDefinition raceDefinition;
@Before
@BeforeEach
public void setUp() throws UnknownHostException, MongoException {
Map<Competitor, Boat> competitorsAndBoats = new HashMap<>();
competitorsAndBoats.put(comp, boat);
@@ -1,9 +1,9 @@
package com.sap.sailing.domain.racelogtracking.test.impl;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.mock;
import java.util.Arrays;
@@ -12,7 +12,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogEndOfTrackingEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogRaceStatusEventImpl;
@@ -1,8 +1,8 @@
package com.sap.sailing.domain.base.racegroup.impl;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.ArrayList;
import java.util.Arrays;
@@ -12,8 +12,8 @@ import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.base.Fleet;
import com.sap.sailing.domain.base.impl.BoatClassImpl;
@@ -38,7 +38,7 @@ public class CurrentRaceFilterImplTest {
private RaceGroup iQFOil;
private Map<RaceGroupSeriesFleetRaceColumn, SimpleFilterableRace> races;
@Before
@BeforeEach
public void setUp() {
races = new HashMap<>();
// five regattas ("RaceGroup"s):
@@ -1,8 +1,8 @@
package com.sap.sailing.domain.coursetemplate.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import static org.junit.Assume.assumeNoException;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;
import java.util.ArrayList;
import java.util.Arrays;
@@ -12,8 +12,8 @@ import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.common.MarkType;
import com.sap.sailing.domain.common.PassingInstruction;
@@ -46,7 +46,7 @@ public class TestLapConfiguration {
private ControlPointTemplate gate;
private Map<MarkRole, MarkTemplate> defaultMarkTemplatesForMarkRoles;
@Before
@BeforeEach
public void setUp() {
startBoat = new MarkTemplateImpl("Start Boat", "SB", /* color */ null, /* shape */ null, /* pattern */ null, MarkType.STARTBOAT);
startBoatRole = new MarkRoleImpl(UUID.randomUUID(), "Start Boat", "SB");
@@ -1,12 +1,12 @@
package com.sap.sailing.domain.racelog.analyzing.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.mockito.Mockito.when;
import java.util.UUID;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
import com.sap.sailing.domain.abstractlog.race.RaceLogFlagEvent;
@@ -1,7 +1,7 @@
package com.sap.sailing.domain.racelog.analyzing.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.mockito.Mockito.when;
import java.util.Arrays;
@@ -9,7 +9,7 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.CompetitorResult;
@@ -1,14 +1,14 @@
package com.sap.sailing.domain.racelog.analyzing.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.mockito.Mockito.mock;
import java.util.ArrayList;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
@@ -38,7 +38,7 @@ public class DependentStartTimeFinderTest {
private RaceLogResolver raceLogResolver;
@Before
@BeforeEach
public void setUp() {
author = new LogEventAuthorImpl("Test", 1);
raceLogA = new RaceLogImpl("raceLogA");
@@ -1,14 +1,14 @@
package com.sap.sailing.domain.racelog.analyzing.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.mockito.Mockito.when;
import java.io.Serializable;
import java.util.Arrays;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
@@ -1,13 +1,13 @@
package com.sap.sailing.domain.racelog.analyzing.test;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.mockito.Mockito.when;
import java.io.Serializable;
import java.util.Arrays;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
@@ -1,12 +1,12 @@
package com.sap.sailing.domain.racelog.analyzing.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.mockito.Mockito.when;
import java.util.Arrays;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
@@ -1,12 +1,12 @@
package com.sap.sailing.domain.racelog.analyzing.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.mockito.Mockito.when;
import java.util.Arrays;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
@@ -1,14 +1,14 @@
package com.sap.sailing.domain.racelog.analyzing.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.mockito.Mockito.when;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
@@ -1,11 +1,11 @@
package com.sap.sailing.domain.racelog.analyzing.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
@@ -1,14 +1,14 @@
package com.sap.sailing.domain.racelog.analyzing.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotSame;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotSame;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.util.Collection;
import java.util.UUID;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
@@ -1,13 +1,13 @@
package com.sap.sailing.domain.racelog.analyzing.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.util.Arrays;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
@@ -6,7 +6,7 @@ import static org.mockito.Mockito.when;
import java.io.Serializable;
import java.util.UUID;
import org.junit.Before;
import org.junit.jupiter.api.BeforeEach;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
@@ -21,7 +21,7 @@ public abstract class RaceLogAnalyzerTest<AnalyzerType extends RaceLogAnalyzer<?
protected AnalyzerType analyzer;
protected RaceLog raceLog;
@Before
@BeforeEach
public void setUpBase() {
raceLog = new RaceLogImpl("RaceLogTest", "test-identifier");
analyzer = createAnalyzer(raceLog);
@@ -1,6 +1,6 @@
package com.sap.sailing.domain.racelog.analyzing.test;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
@@ -9,7 +9,7 @@ import static org.mockito.Mockito.when;
import java.util.Arrays;
import java.util.Collections;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
@@ -1,9 +1,9 @@
package com.sap.sailing.domain.racelog.analyzing.test;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertSame;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
@@ -1,13 +1,13 @@
package com.sap.sailing.domain.racelog.analyzing.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.util.Arrays;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
@@ -1,13 +1,13 @@
package com.sap.sailing.domain.racelog.analyzing.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.util.List;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
@@ -1,13 +1,13 @@
package com.sap.sailing.domain.racelog.state.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
@@ -67,7 +67,7 @@ public class DependentRaceStateTest {
private RaceLogResolver raceLogResolver;
@Before
@BeforeEach
public void setUp() {
author = new LogEventAuthorImpl("Test", 1);
configuration = new EmptyRegattaConfiguration();
@@ -1,10 +1,10 @@
package com.sap.sailing.domain.racelog.state.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
@@ -13,8 +13,8 @@ import static org.mockito.Mockito.when;
import java.util.UUID;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
@@ -55,7 +55,7 @@ public class RaceStateTest {
private RaceState state;
@Before
@BeforeEach
public void setUp() {
raceLog = new RaceLogImpl("test-log");
author = new LogEventAuthorImpl("Test", 1);
@@ -1,9 +1,9 @@
package com.sap.sailing.domain.racelog.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
@@ -1,12 +1,12 @@
package com.sap.sailing.domain.racelog.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
@@ -22,7 +22,7 @@ public class RaceLogEventComparatorTest {
private RaceLogEventComparator comparator;
@Before
@BeforeEach
public void setUp() {
eventOne = mock(RaceLogEvent.class);
eventTwo = mock(RaceLogEvent.class);
@@ -1,6 +1,6 @@
package com.sap.sailing.domain.racelog.test;
import static org.junit.Assert.assertSame;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.mockito.Mockito.mock;
import java.io.Serializable;
@@ -2,13 +2,13 @@ package com.sap.sailing.domain.racelog.test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.hamcrest.Matchers.in;
import static org.junit.Assert.assertEquals;
import java.util.UUID;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
@@ -37,7 +37,7 @@ public class RaceLogRevocationTest {
private UUID clientCUUID = UUID.randomUUID();
private AbstractLogEventAuthor clientCAuthor = new LogEventAuthorImpl("clientC", 0);
@Before
@BeforeEach
public void setup() {
serverRaceLog = new RaceLogImpl("server");
clientARaceLog = new RaceLogImpl("clientA");
@@ -1,11 +1,11 @@
package com.sap.sailing.domain.racelog.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
@@ -14,8 +14,8 @@ import static org.mockito.Mockito.when;
import java.util.UUID;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
@@ -52,7 +52,7 @@ public class RaceLogTest {
}
@Before
@BeforeEach
public void setUp() {
raceLog = new RaceLogImpl("testlock", "test-identifier");
}
@@ -1,11 +1,11 @@
package com.sap.sailing.domain.racelog.test;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.UUID;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogImpl;
import com.sap.sailing.domain.abstractlog.race.state.racingprocedure.ReadonlyRacingProcedure;
@@ -18,7 +18,7 @@ public class RacingProceduresWithStartModeFlagTest {
private RacingProcedureFactoryImpl racingProcedureFactory;
private RaceLogImpl raceLog;
@Before
@BeforeEach
public void setUp() {
this.racingProcedureFactory = new RacingProcedureFactoryImpl(/* author */ null, new EmptyRegattaConfiguration());
this.raceLog = new RaceLogImpl(UUID.randomUUID());
@@ -29,10 +29,10 @@ public class RacingProceduresWithStartModeFlagTest {
for (final RacingProcedureType type : RacingProcedureType.values()) {
if (type != RacingProcedureType.UNKNOWN) {
final ReadonlyRacingProcedure racingProcedure = racingProcedureFactory.createRacingProcedure(type, raceLog, /* raceLogResolver */ null);
assertEquals("Racing procedure type "+type.name()+" was "+((racingProcedure instanceof ConfigurableStartModeFlagRacingProcedure) ? "" : "not ")+
"considered one with configurable start mode flag but should have",
RacingProcedureType.RRS26.equals(type) || RacingProcedureType.RRS26_3MIN.equals(type) || RacingProcedureType.SWC.equals(type) || RacingProcedureType.SWC_4MIN.equals(type),
racingProcedure instanceof ConfigurableStartModeFlagRacingProcedure);
assertEquals(RacingProcedureType.RRS26.equals(type) || RacingProcedureType.RRS26_3MIN.equals(type) || RacingProcedureType.SWC.equals(type) || RacingProcedureType.SWC_4MIN.equals(type),
racingProcedure instanceof ConfigurableStartModeFlagRacingProcedure,
"Racing procedure type "+type.name()+" was "+((racingProcedure instanceof ConfigurableStartModeFlagRacingProcedure) ? "" : "not ")+
"considered one with configurable start mode flag but should have");
}
}
}
@@ -1,13 +1,13 @@
package com.sap.sailing.domain.racelog.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.Collection;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
@@ -27,7 +27,7 @@ public class RegattaLogRevocationTest {
private RegattaLog serverRegattaLog;
private AbstractLogEventAuthor serverAuthor = new LogEventAuthorImpl("server", 2);
@Before
@BeforeEach
public void setup() {
serverRegattaLog = new RegattaLogImpl("server");
}
@@ -1,6 +1,6 @@
package com.sap.sailing.domain.racelog.test;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -8,8 +8,8 @@ import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
@@ -30,7 +30,7 @@ public class SerializeRaceLogEventsTest {
private ByteArrayOutputStream bos;
private RaceLog raceLog;
@Before
@BeforeEach
public void setUp() throws IOException {
bos = new ByteArrayOutputStream();
oos = new ObjectOutputStream(bos);
@@ -1,6 +1,6 @@
package com.sap.sailing.domain.racelog.tracking.analyzing.test;
import org.junit.Before;
import org.junit.jupiter.api.BeforeEach;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
@@ -21,7 +21,7 @@ public abstract class AbstractRaceLogTrackingTest {
super();
}
@Before
@BeforeEach
public void setup() {
log = new RaceLogImpl("log");
}
@@ -1,6 +1,6 @@
package com.sap.sailing.domain.regattalog.tracking.analyzing.test;
import org.junit.Before;
import org.junit.jupiter.api.BeforeEach;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
@@ -21,7 +21,7 @@ public abstract class AbstractRegattaLogTrackingTest {
super();
}
@Before
@BeforeEach
public void setup() {
log = new RegattaLogImpl("log");
}
@@ -1,12 +1,12 @@
package com.sap.sailing.domain.regattalog.tracking.analyzing.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertSame;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertSame;
import java.util.Collections;
import java.util.Set;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.abstractlog.regatta.RegattaLog;
import com.sap.sailing.domain.abstractlog.regatta.RegattaLogEvent;
@@ -1,14 +1,15 @@
package com.sap.sailing.domain.regattalog.tracking.analyzing.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.regatta.RegattaLogEvent;
@@ -24,8 +25,6 @@ import com.sap.sailing.domain.racelogtracking.impl.SmartphoneImeiIdentifierImpl;
import com.sap.sse.common.TimePoint;
import com.sap.sse.common.impl.MillisecondsTimePoint;
import org.junit.Assert;
public class DeviceMappingFinderTest extends AbstractRegattaLogTrackingTest {
private final Competitor competitor = new CompetitorImpl("comp", "Comp", "KYC", null, null, null, null, /* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
private final Competitor competitor2 = new CompetitorImpl("comp2", "Comp2", "KYC", null, null, null, null, /* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
@@ -285,11 +284,11 @@ public class DeviceMappingFinderTest extends AbstractRegattaLogTrackingTest {
addMapping(author, device, 10L, 40L, competitor2);
addMapping(author, device, 20L, 30L, competitor2);
addMapping(author, device, 50L, 90L, competitor);
Assert.assertEquals(2, getMappings().size());
Assertions.assertEquals(2, getMappings().size());
//non-overlap with new device
addMapping(author, new SmartphoneImeiIdentifierImpl("imei2"), 110L, 150L, competitor);
Assert.assertEquals(3, getMappings().size());
Assertions.assertEquals(3, getMappings().size());
}
@Test
@@ -1,12 +1,12 @@
package com.sap.sailing.domain.regattalog.tracking.analyzing.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import java.util.UUID;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.abstractlog.regatta.events.impl.RegattaLogDeviceMarkMappingEventImpl;
import com.sap.sailing.domain.abstractlog.regatta.impl.OpenEndedDeviceMappingFinder;
@@ -21,7 +21,7 @@ public class OpenEndedDeviceMappingFinderTest extends AbstractRegattaLogTracking
private Mark mappedToMark;
private UUID deviceUuid;
@Before
@BeforeEach
public void setUp() {
mappedToMark = new MarkImpl(UUID.randomUUID(), "Random Mark");
deviceUuid = UUID.randomUUID();
@@ -2,9 +2,8 @@ package com.sap.sailing.domain.regattalog.tracking.analyzing.test;
import java.util.UUID;
import org.junit.Assert;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.abstractlog.regatta.RegattaLogEvent;
import com.sap.sailing.domain.abstractlog.regatta.events.RegattaLogRevokeEvent;
@@ -23,7 +22,7 @@ public class RevokeEventTest extends AbstractRegattaLogTrackingTest {
log.add(revokeEvent);
log.lockForRead();
Assert.assertFalse(Util.contains(log.getUnrevokedEvents(), event));
Assertions.assertFalse(Util.contains(log.getUnrevokedEvents(), event));
log.unlockAfterRead();
}
@@ -37,7 +36,7 @@ public class RevokeEventTest extends AbstractRegattaLogTrackingTest {
log.add(revokeEvent);
log.lockForRead();
Assert.assertTrue(Util.contains(log.getUnrevokedEvents(), event));
Assertions.assertTrue(Util.contains(log.getUnrevokedEvents(), event));
log.unlockAfterRead();
}
@@ -53,9 +52,9 @@ public class RevokeEventTest extends AbstractRegattaLogTrackingTest {
log.add(revokeEvent);
log.lockForRead();
Assert.assertFalse(Util.contains(log.getUnrevokedEvents(), event));
Assert.assertFalse(Util.contains(log.getUnrevokedEvents(), revokeEvent));
Assert.assertFalse(Util.contains(log.getUnrevokedEvents(), revokeEvent2));
Assertions.assertFalse(Util.contains(log.getUnrevokedEvents(), event));
Assertions.assertFalse(Util.contains(log.getUnrevokedEvents(), revokeEvent));
Assertions.assertFalse(Util.contains(log.getUnrevokedEvents(), revokeEvent2));
log.unlockAfterRead();
}
}
@@ -1,15 +1,15 @@
package com.sap.sailing.util.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import java.util.Iterator;
import java.util.Random;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.sap.sse.concurrent.ConcurrentHashBag;
@@ -24,7 +24,7 @@ public class ConcurrentHashBagTest {
final static Random random = new Random();
private ConcurrentHashBag<String> bag;
@Before
@BeforeEach
public void setUp() {
bag = new ConcurrentHashBag<>();
}
@@ -1,10 +1,10 @@
package com.sap.sailinig.domain.based.impl;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertSame;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertSame;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceLogResolver;
import com.sap.sailing.domain.base.BoatClass;
@@ -22,7 +22,7 @@ import com.sap.sailing.domain.common.BoatClassMasterdata;
public class BoatClassCacheTest {
private SharedDomainFactory<RaceLogResolver> sharedDomainFactory;
@Before
@BeforeEach
public void setUp() {
sharedDomainFactory = new SharedDomainFactoryImpl<>(/* raceLogResolver */ null);
}
@@ -70,7 +70,7 @@ public class BoatClassCacheTest {
public void testEssMayHaveNonUpwindStart() {
for (final String boatClassName : new String[] { "extreme40", "ess", "ess40" }) {
final BoatClass ess40 = sharedDomainFactory.getOrCreateBoatClass(boatClassName);
assertFalse("Boat class "+boatClassName+" expected to allow for non-upwind starts", ess40.typicallyStartsUpwind());
assertFalse(ess40.typicallyStartsUpwind(), "Boat class "+boatClassName+" expected to allow for non-upwind starts");
}
}
}
@@ -4,8 +4,8 @@ import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsNull.notNullValue;
import static org.hamcrest.MatcherAssert.assertThat;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.base.DomainFactory;
import com.sap.sailing.domain.swisstimingadapter.RaceType;
@@ -15,7 +15,7 @@ public class DomainFactoryTest {
private com.sap.sailing.domain.swisstimingadapter.impl.DomainFactoryImpl swissTimingDomainFactory;
@Before
@BeforeEach
public void before() {
com.sap.sailing.domain.base.DomainFactory baseDomainFactory = new com.sap.sailing.domain.base.impl.DomainFactoryImpl(DomainFactory.TEST_RACE_LOG_RESOLVER);
swissTimingDomainFactory = new com.sap.sailing.domain.swisstimingadapter.impl.DomainFactoryImpl(
@@ -1,13 +1,13 @@
package com.sap.sailing.domain.swisstimingadapter.impl;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.IOException;
import java.net.UnknownHostException;
import java.text.ParseException;
import java.util.Collection;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.swisstimingadapter.Fix;
import com.sap.sailing.domain.swisstimingadapter.RaceStatus;
@@ -1,10 +1,10 @@
package com.sap.sailing.domain.swisstimingadapter.impl;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import org.junit.Test;
import org.junit.jupiter.api.Test;
public class SequenceNumberParsingTest {
@Test
@@ -1,14 +1,14 @@
package com.sap.sailing.domain.swisstimingadapter.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.swisstimingadapter.SwissTimingFactory;
import com.sap.sailing.domain.swisstimingadapter.SwissTimingFormatException;
@@ -1,7 +1,7 @@
package com.sap.sailing.domain.swisstimingadapter.test;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.io.IOException;
import java.net.ConnectException;
@@ -18,10 +18,10 @@ import java.util.List;
import java.util.TimeZone;
import java.util.logging.Logger;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.rules.Timeout;
import com.sap.sailing.domain.common.TrackedRaceStatusEnum;
@@ -59,7 +59,7 @@ public class SailMasterConnectivityTest {
private SailMasterConnector connector4712;
@Before
@BeforeEach
public void setUp() throws InterruptedException, ParseException {
startSailMasterDummy();
Race race4702 = new RaceImpl("W4702", "R2", "470 Women Race 2");
@@ -79,7 +79,7 @@ public class SailMasterConnectivityTest {
Thread.sleep(100); // give dummy sail master server a change to start listening on its socket
}
@After
@AfterEach
public void tearDown() throws IOException, InterruptedException {
connector4702.sendRequestAndGetResponse(MessageType._STOPSERVER);
connector4711.stop();
@@ -1,7 +1,7 @@
package com.sap.sailing.domain.swisstimingadapter.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import java.util.ArrayList;
import java.util.Arrays;
@@ -9,7 +9,7 @@ import java.util.Collections;
import java.util.List;
import java.util.UUID;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.base.BoatClass;
import com.sap.sailing.domain.base.RaceDefinition;
@@ -1,9 +1,9 @@
package com.sap.sailing.domain.swisstimingadapter.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.IOException;
import java.net.UnknownHostException;
@@ -13,10 +13,10 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.common.TrackedRaceStatusEnum;
import com.sap.sailing.domain.swisstimingadapter.Competitor;
@@ -35,17 +35,17 @@ import com.sap.sse.common.Speed;
import com.sap.sse.common.TimePoint;
import com.sap.sse.common.Util;
@Ignore("This test doesn't work as long as the server doesn't play an actual race")
@Disabled("This test doesn't work as long as the server doesn't play an actual race")
public class SwissTimingSailMasterLiveTest implements SailMasterListener {
private int rpdCounter;
private SailMasterConnector connector;
@Before
@BeforeEach
public void connect() throws InterruptedException, ParseException {
connector = SwissTimingFactory.INSTANCE.getOrCreateSailMasterConnector("gps.sportresult.com", 40300, "W4702", /* raceDataUrl */ null, "R2", "Women 470 Race 2", null /* boat class*/, /* SwissTimingRaceTracker */ null);
}
@After
@AfterEach
public void stopConnector() throws IOException {
connector.stop();
}
@@ -1,13 +1,13 @@
package com.sap.sailing.domain.swisstimingreplayadapter.test;
import org.junit.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.swisstimingreplayadapter.impl.MarkType;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
public class MarkTypeTest {
@Test
@@ -1,9 +1,9 @@
package com.sap.sailing.domain.swisstimingreplayadapter.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import java.io.IOException;
import java.io.InputStream;
@@ -14,8 +14,8 @@ import java.text.MessageFormat;
import java.text.ParseException;
import java.util.List;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.swisstimingadapter.DomainFactory;
import com.sap.sailing.domain.swisstimingreplayadapter.SwissTimingReplayRace;
@@ -34,7 +34,7 @@ public class SwissTimingRaceConfigurationTest {
assertFalse(races.isEmpty());
}
@Ignore("SwissTiming shut down their configuration server for good (2020-11-13), so we cannot get at the configs anymore")
@Disabled("SwissTiming shut down their configuration server for good (2020-11-13), so we cannot get at the configs anymore")
@Test
public void testRaceConfig_446483_no_detail_config() throws Exception {
URL configFileURL = new URL(MessageFormat.format(SwissTimingReplayServiceImpl.RACE_CONFIG_URL_TEMPLATE, "446483"));
@@ -53,7 +53,7 @@ public class SwissTimingRaceConfigurationTest {
}
@Ignore("SwissTiming shut down their configuration server for good (2020-11-13), so we cannot get at the configs anymore")
@Disabled("SwissTiming shut down their configuration server for good (2020-11-13), so we cannot get at the configs anymore")
@Test
public void testRaceConfig_6260_with_detail_config() throws Exception {
URL configFileURL = new URL(MessageFormat.format(SwissTimingReplayServiceImpl.RACE_CONFIG_URL_TEMPLATE, "6260"));
@@ -1,10 +1,10 @@
package com.sap.sailing.domain.swisstimingreplayadapter.test;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.mock;
import java.io.ByteArrayInputStream;
@@ -15,8 +15,8 @@ import java.net.URL;
import java.util.List;
import java.util.Map.Entry;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.base.Boat;
import com.sap.sailing.domain.base.Competitor;
@@ -78,7 +78,7 @@ public class SwissTimingReplayAdapterServiceTest {
assertEquals(321920, replayCountListener.rankingMarkCount);
}
@Ignore("SwissTiming has shut down the ota2.sportresult.com server around 2020-11-13")
@Disabled("SwissTiming has shut down the ota2.sportresult.com server around 2020-11-13")
@Test
public void testRaceData_SAW005905_20120805_EqualsOnlineVersion() throws Exception {
byte[] localCopy = read(getClass().getResourceAsStream("/SAW005905.20120805.replay"));
@@ -1,10 +1,10 @@
package com.sap.sailing.domain.common;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertSame;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.base.BoatClass;
import com.sap.sailing.domain.base.DomainFactory;
@@ -1,9 +1,9 @@
package com.sap.sailing.domain.common;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.common.media.MediaTrack;
import com.sap.sse.common.Duration;
@@ -1,9 +1,9 @@
package com.sap.sailing.domain.common;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.common.media.MediaUtil;
import com.sap.sse.common.TimePoint;
@@ -1,8 +1,8 @@
package com.sap.sailing.domain.common.test;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.common.BearingChangeAnalyzer;
import com.sap.sse.common.impl.DegreeBearingImpl;
@@ -1,8 +1,8 @@
package com.sap.sailing.domain.common.test;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.common.impl.MeterPerSecondSpeedImpl;
import com.sap.sse.common.Speed;
@@ -1,11 +1,11 @@
package com.sap.sailing.domain.common.test;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import com.sap.sailing.domain.common.impl.ColorMapImpl;
import com.sap.sse.common.Color;

Some files were not shown because too many files have changed in this diff Show More