assertThat((String) getResponse.getField("str").getValue(), equalTo("test"));
assertThat(getResponse.getField("strs").getValues(), contains((Object) "A", "B", "C"));
assertThat((Integer) getResponse.getField("int").getValue(), equalTo(42));
assertThat(getResponse.getField("ints").getValues(), contains((Object) 1, 2, 3, 4));
assertThat((String) getResponse.getField("date").getValue(), equalTo("2012-11-13T15:26:14.000Z"));
assertThat((BytesReference) getResponse.getField("binary").getValue(), equalTo((BytesReference) new BytesArray(new byte[]{1, 2, 3})));
logger.info("--> flush the index, so we load it from it");
flush();
logger.info("--> non realtime get (from source)");
getResponse = client().prepareGet("test", "type1", "1").setFields("str", "strs", "int", "ints", "date", "binary").get();
assertThat(getResponse.isExists(), equalTo(true));
assertThat((String) getResponse.getField("str").getValue(), equalTo("test"));
assertThat(getResponse.getField("strs").getValues(), contains((Object) "A", "B", "C"));
assertThat((Long) getResponse.getField("int").getValue(), equalTo(42l));
assertThat(getResponse.getField("ints").getValues(), contains((Object) 1L, 2L, 3L, 4L));
assertThat((String) getResponse.getField("date").getValue(), equalTo("2012-11-13T15:26:14.000Z"));
assertThat(getResponse.getField("binary").getValue(), instanceOf(String.class)); // its a String..., not binary mapped
logger.info("--> non realtime get (from stored fields)");
getResponse = client().prepareGet("test", "type2", "1").setFields("str", "strs", "int", "ints", "date", "binary").get();
assertThat(getResponse.isExists(), equalTo(true));
assertThat((String) getResponse.getField("str").getValue(), equalTo("test"));
assertThat(getResponse.getField("strs").getValues(), contains((Object) "A", "B", "C"));
assertThat((Integer) getResponse.getField("int").getValue(), equalTo(42));
assertThat(getResponse.getField("ints").getValues(), contains((Object) 1, 2, 3, 4));
assertThat((String) getResponse.getField("date").getValue(), equalTo("2012-11-13T15:26:14.000Z"));
assertThat((BytesReference) getResponse.getField("binary").getValue(), equalTo((BytesReference) new BytesArray(new byte[]{1, 2, 3})));
}