Search in sources :

Example 1 with Coordinate

use of com.dtflys.test.model.Coordinate in project forest by dromara.

the class TestForestJacksonConverter method testJavaObjectToMap.

@Test
public void testJavaObjectToMap() {
    Coordinate coordinate = new Coordinate("11.11111", "22.22222");
    ForestJacksonConverter forestJacksonConverter = new ForestJacksonConverter();
    Map map = forestJacksonConverter.convertObjectToMap(coordinate);
    assertNotNull(map);
    assertEquals("11.11111", map.get("longitude"));
    assertEquals("22.22222", map.get("latitude"));
}
Also used : SubCoordinate(com.dtflys.test.model.SubCoordinate) Coordinate(com.dtflys.test.model.Coordinate) ForestJacksonConverter(com.dtflys.forest.converter.json.ForestJacksonConverter) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) Test(org.junit.Test)

Example 2 with Coordinate

use of com.dtflys.test.model.Coordinate in project forest by dromara.

the class TestGsonConverter method testJavaObjectToMap.

@Test
public void testJavaObjectToMap() {
    Coordinate coordinate = new Coordinate("11.11111", "22.22222");
    ForestGsonConverter gsonConverter = new ForestGsonConverter();
    Map map = gsonConverter.convertObjectToMap(coordinate);
    assertNotNull(map);
    assertEquals("11.11111", map.get("longitude"));
    assertEquals("22.22222", map.get("latitude"));
}
Also used : SubCoordinate(com.dtflys.test.model.SubCoordinate) Coordinate(com.dtflys.test.model.Coordinate) ForestGsonConverter(com.dtflys.forest.converter.json.ForestGsonConverter) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) Test(org.junit.Test)

Example 3 with Coordinate

use of com.dtflys.test.model.Coordinate in project forest by dromara.

the class TestForestFastjsonConverter method testJavaObjectToMap.

@Test
public void testJavaObjectToMap() {
    Coordinate coordinate = new Coordinate("11.11111", "22.22222");
    ForestFastjsonConverter forestFastjsonConverter = new ForestFastjsonConverter();
    Map map = forestFastjsonConverter.convertObjectToMap(coordinate);
    assertNotNull(map);
    assertEquals("11.11111", map.get("longitude"));
    assertEquals("22.22222", map.get("latitude"));
}
Also used : ForestFastjsonConverter(com.dtflys.forest.converter.json.ForestFastjsonConverter) SubCoordinate(com.dtflys.test.model.SubCoordinate) Coordinate(com.dtflys.test.model.Coordinate) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) Test(org.junit.Test)

Aggregations

Coordinate (com.dtflys.test.model.Coordinate)3 SubCoordinate (com.dtflys.test.model.SubCoordinate)3 LinkedHashMap (java.util.LinkedHashMap)3 Map (java.util.Map)3 Test (org.junit.Test)3 HashMap (java.util.HashMap)2 ForestFastjsonConverter (com.dtflys.forest.converter.json.ForestFastjsonConverter)1 ForestGsonConverter (com.dtflys.forest.converter.json.ForestGsonConverter)1 ForestJacksonConverter (com.dtflys.forest.converter.json.ForestJacksonConverter)1