@Test public void complexPropertyWithStringToStringMappingStandalone() throws Exception { final String complexPropertyJson = "{\"d\":{\"City\":{\"__metadata\":{\"type\":\"RefScenario.c_City\"}," + "\"PostalCode\":\"69124\",\"CityName\":\"Heidelberg\"}}}"; JsonReader reader = prepareReader(complexPropertyJson); final EdmProperty property = (EdmProperty) MockFacade.getMockEdm().getComplexType("RefScenario", "c_Location").getProperty("City"); EntityProviderReadProperties readProperties = mock(EntityProviderReadProperties.class); Map<String, Object> innerMappings = new HashMap<String, Object>(); innerMappings.put("PostalCode", String.class); Map<String, Object> typeMappings = new HashMap<String, Object>(); typeMappings.put("City", innerMappings); when(readProperties.getTypeMappings()).thenReturn(typeMappings); Map<String, Object> result = new JsonPropertyConsumer().readPropertyStandalone(reader, property, readProperties); assertEquals(1, result.size()); @SuppressWarnings("unchecked") Map<String, Object> innerResult = (Map<String, Object>) result.get("City"); assertEquals("Heidelberg", innerResult.get("CityName")); assertEquals("69124", innerResult.get("PostalCode")); }
public Map<String, Object> readPropertyStandalone(JsonReader reader, final EdmProperty edmProperty, final EntityProviderReadProperties readProperties) throws EntityProviderException { return readPropertyStandalone(reader, EntityInfoAggregator.create(edmProperty), readProperties); }
JsonPropertyConsumer { public Map<String, Object> readPropertyStandalone(JsonReader reader, final EdmProperty edmProperty, final EntityProviderReadProperties readProperties) throws EntityProviderException { return readPropertyStandalone(reader, EntityInfoAggregator.create(edmProperty), readProperties); } }
JsonPropertyConsumer { public Map<String, Object> readPropertyStandalone(JsonReader reader, final EdmProperty edmProperty, final EntityProviderReadProperties readProperties) throws EntityProviderException { return readPropertyStandalone(reader, EntityInfoAggregator.create(edmProperty), readProperties); }  }
JsonPropertyConsumer { public Map<String, Object> readPropertyStandalone(JsonReader reader, final EdmProperty edmProperty, final EntityProviderReadProperties readProperties) throws EntityProviderException { return readPropertyStandalone(reader, EntityInfoAggregator.create(edmProperty), readProperties); }  Map<String, Object> readPropertyStandalone(JsonReader reader, final EdmProperty edmProperty,
      final EntityProviderReadProperties readProperties); Map<String, Object> readPropertyStandalone(final JsonReader reader, final EntityPropertyInfo propertyInfo,
      final EntityProviderReadProperties readProperties); List<?> readCollection(JsonReader reader, final EntityPropertyInfo propertyInfo,
        final EntityProviderReadProperties readProperties); }
JsonPropertyConsumer { public Map<String, Object> readPropertyStandalone(JsonReader reader, final EdmProperty edmProperty, final EntityProviderReadProperties readProperties) throws EntityProviderException { return readPropertyStandalone(reader, EntityInfoAggregator.create(edmProperty), readProperties); }  Map<String, Object> readPropertyStandalone(JsonReader reader, final EdmProperty edmProperty,
      final EntityProviderReadProperties readProperties); Map<String, Object> readPropertyStandalone(final JsonReader reader, final EntityPropertyInfo propertyInfo,
      final EntityProviderReadProperties readProperties); List<?> readCollection(JsonReader reader, final EntityPropertyInfo propertyInfo,
        final EntityProviderReadProperties readProperties);  }