Search in sources :

Example 1 with MapGenerator

use of com.enonic.xp.script.serializer.MapGenerator in project xp by enonic.

the class PropertyTreeMapperTest method raw_values.

@Test
public void raw_values() throws Exception {
    final PropertyTree properties = new PropertyTree();
    final GeoPoint geoPointValue = GeoPoint.from("80,80");
    properties.addGeoPoint("myGeoPoint", geoPointValue);
    MapGenerator generator = Mockito.mock(MapGenerator.class);
    new PropertyTreeMapper(true, properties).serialize(generator);
    Mockito.verify(generator).rawValue("myGeoPoint", geoPointValue);
}
Also used : GeoPoint(com.enonic.xp.util.GeoPoint) JsonMapGenerator(com.enonic.xp.script.serializer.JsonMapGenerator) MapGenerator(com.enonic.xp.script.serializer.MapGenerator) PropertyTree(com.enonic.xp.data.PropertyTree) Test(org.junit.jupiter.api.Test)

Example 2 with MapGenerator

use of com.enonic.xp.script.serializer.MapGenerator in project xp by enonic.

the class PropertyTreeMapperTest method raw_values.

@Test
public void raw_values() throws Exception {
    final PropertyTree properties = new PropertyTree();
    final GeoPoint geoPointValue = GeoPoint.from("80,80");
    properties.addGeoPoint("myGeoPoint", geoPointValue);
    MapGenerator generator = Mockito.mock(MapGenerator.class);
    new PropertyTreeMapper(true, properties).serialize(generator);
    Mockito.verify(generator).rawValue("myGeoPoint", geoPointValue);
}
Also used : GeoPoint(com.enonic.xp.util.GeoPoint) JsonMapGenerator(com.enonic.xp.script.serializer.JsonMapGenerator) MapGenerator(com.enonic.xp.script.serializer.MapGenerator) PropertyTree(com.enonic.xp.data.PropertyTree) Test(org.junit.jupiter.api.Test)

Aggregations

PropertyTree (com.enonic.xp.data.PropertyTree)2 JsonMapGenerator (com.enonic.xp.script.serializer.JsonMapGenerator)2 MapGenerator (com.enonic.xp.script.serializer.MapGenerator)2 GeoPoint (com.enonic.xp.util.GeoPoint)2 Test (org.junit.jupiter.api.Test)2