use of com.amazonaws.transform.MapUnmarshaller in project aws-sdk-android by aws-amplify.
the class JsonUnmarshallerTest method testSimpleMap.
@Test
public void testSimpleMap() throws Exception {
JsonUnmarshallerContext unmarshallerContext = setupUnmarshaller(SIMPLE_MAP);
MapUnmarshaller<String> unmarshaller = new MapUnmarshaller<String>(SimpleTypeJsonUnmarshallers.StringJsonUnmarshaller.getInstance());
Map<String, String> map = unmarshaller.unmarshall(unmarshallerContext);
assertTrue(map.size() == 2);
assertEquals("value1", map.get("key1"));
assertEquals("value2", map.get("key2"));
}
use of com.amazonaws.transform.MapUnmarshaller in project aws-sdk-android by aws-amplify.
the class JsonUnmarshallerTest method testMapToList.
@Test
public void testMapToList() throws Exception {
JsonUnmarshallerContext unmarshallerContext = setupUnmarshaller(MAP_TO_LIST);
MapUnmarshaller<List<String>> unmarshaller = new MapUnmarshaller<List<String>>(new ListUnmarshaller<String>(SimpleTypeJsonUnmarshallers.StringJsonUnmarshaller.getInstance()));
Map<String, List<String>> map = unmarshaller.unmarshall(unmarshallerContext);
assertTrue(map.size() == 2);
assertEquals(Arrays.asList(null, "value1"), map.get("key1"));
assertEquals(Arrays.asList("value2"), map.get("key2"));
}
Aggregations