mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-14 16:20:57 +00:00
CourseArea now implements WithID
This commit is contained in:
1 parent
da3ceeb27d
commit
12bf61007a
10 files changed
+526
-492
No files matched your search
+50
-43
@@ -1,43 +1,50 @@
|
||||
package com.sap.sailing.server.gateway.serialization.test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import org.json.simple.JSONObject;
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.sap.sailing.domain.base.CourseArea;
|
||||
import com.sap.sailing.server.gateway.serialization.impl.CourseAreaJsonSerializer;
|
||||
|
||||
public class CourseAreaJsonSerializerTest {
|
||||
|
||||
protected CourseArea courseArea;
|
||||
protected CourseAreaJsonSerializer serializer;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
courseArea = mock(CourseArea.class);
|
||||
serializer = new CourseAreaJsonSerializer();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testName() {
|
||||
String expectedName = "Cruiser";
|
||||
when(courseArea.getName()).thenReturn(expectedName);
|
||||
|
||||
JSONObject result = serializer.serialize(courseArea);
|
||||
|
||||
assertEquals(
|
||||
expectedName,
|
||||
result.get(CourseAreaJsonSerializer.FIELD_NAME));
|
||||
}
|
||||
|
||||
@Ignore
|
||||
@Test
|
||||
public void testRaces() {
|
||||
/// TODO: Implement a test for checking if races are correctly serialized on course areas
|
||||
}
|
||||
}
|
||||
package com.sap.sailing.server.gateway.serialization.test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import org.json.simple.JSONObject;
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.sap.sailing.domain.base.CourseArea;
|
||||
import com.sap.sailing.server.gateway.serialization.impl.CourseAreaJsonSerializer;
|
||||
|
||||
public class CourseAreaJsonSerializerTest {
|
||||
|
||||
protected final UUID expectedId = UUID.randomUUID();
|
||||
protected final String expectedName = "Cruiser";
|
||||
|
||||
protected CourseArea courseArea;
|
||||
protected CourseAreaJsonSerializer serializer;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
courseArea = mock(CourseArea.class);
|
||||
serializer = new CourseAreaJsonSerializer();
|
||||
|
||||
when(courseArea.getName()).thenReturn(expectedName);
|
||||
when(courseArea.getId()).thenReturn(expectedId);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBasicAttributes() {
|
||||
JSONObject result = serializer.serialize(courseArea);
|
||||
|
||||
assertEquals(
|
||||
expectedName,
|
||||
result.get(CourseAreaJsonSerializer.FIELD_NAME));
|
||||
assertEquals(
|
||||
expectedId,
|
||||
result.get(CourseAreaJsonSerializer.FIELD_ID));
|
||||
}
|
||||
|
||||
@Ignore
|
||||
public void testRaces() {
|
||||
/// TODO: Implement a test for checking if races are correctly serialized on course areas
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user