blob: 5d204b81982e7839027638066dadd0062807d836 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
package org.geojson.jackson;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.geojson.LngLatAlt;
import org.junit.Assert;
import org.junit.Test;
/**
* Created by babbleshack on 27/11/16.
*/
public class LngLatAltDeserializerTest {
@Test
public void deserializeMongoLngLatAlt() throws Exception {
LngLatAlt lngLatAlt = new LngLatAlt(10D, 15D, 5);
String lngLatAltJson = new ObjectMapper().writeValueAsString(lngLatAlt);
lngLatAltJson.replace("10.0", "\"10.0\"");
lngLatAltJson.replace("15.0", "\"15.0\"");
LngLatAlt lngLatAlt1 = new ObjectMapper().readValue(lngLatAltJson, LngLatAlt.class);
Assert.assertTrue(lngLatAlt.equals(lngLatAlt));
}
}
|