Search in sources :

Example 1 with SubCoordinate

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

the class TestForestFastjsonConverter method testJavaObjectToMap2.

@Test
public void testJavaObjectToMap2() {
    SubCoordinate coordinate = new SubCoordinate("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) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) Test(org.junit.Test)

Example 2 with SubCoordinate

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

the class TestForestJacksonConverter method testJavaObjectToMap2.

@Test
public void testJavaObjectToMap2() {
    SubCoordinate coordinate = new SubCoordinate("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 : ForestJacksonConverter(com.dtflys.forest.converter.json.ForestJacksonConverter) SubCoordinate(com.dtflys.test.model.SubCoordinate) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) Test(org.junit.Test)

Example 3 with SubCoordinate

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

the class TestGsonConverter method testJavaObjectToMap2.

@Test
public void testJavaObjectToMap2() {
    SubCoordinate coordinate = new SubCoordinate("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 : ForestGsonConverter(com.dtflys.forest.converter.json.ForestGsonConverter) SubCoordinate(com.dtflys.test.model.SubCoordinate) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) Test(org.junit.Test)

Aggregations

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