@Test void simpleListValue() throws NoSuchMethodException { final List<ParameterMeta> params = service .buildParameterMetas(MethodsHolder.class.getMethod("collections", List.class, List.class, Map.class), "def", new BaseParameterEnricher.Context(new LocalConfigurationService(emptyList(), "test"))); final Map<String, String> payload = new HashMap<>(); payload.put("ports[0]", "1"); payload.put("ports[1]", "2"); final JsonValue value = extractorFactory.visitAndMap(params, payload); assertEquals("{\"ports\":[1,2]}", value.toString()); }
public JsonObject visitAndMap(final Collection<ParameterMeta> parameters, final Map<String, String> payload) { return unflatten("", ofNullable(parameters).orElseGet(Collections::emptyList), payload == null ? emptyMap() : payload); }
PayloadMapper { public JsonObject visitAndMap(final Collection<ParameterMeta> parameters, final Map<String, String> payload) { return unflatten("", ofNullable(parameters).orElseGet(Collections::emptyList), payload == null ? emptyMap() : payload); } }
PayloadMapper { public JsonObject visitAndMap(final Collection<ParameterMeta> parameters, final Map<String, String> payload) { return unflatten("", ofNullable(parameters).orElseGet(Collections::emptyList), payload == null ? emptyMap() : payload); }  }
PayloadMapper { public JsonObject visitAndMap(final Collection<ParameterMeta> parameters, final Map<String, String> payload) { return unflatten("", ofNullable(parameters).orElseGet(Collections::emptyList), payload == null ? emptyMap() : payload); }  JsonObject visitAndMap(final Collection<ParameterMeta> parameters, final Map<String, String> payload); }
PayloadMapper { public JsonObject visitAndMap(final Collection<ParameterMeta> parameters, final Map<String, String> payload) { return unflatten("", ofNullable(parameters).orElseGet(Collections::emptyList), payload == null ? emptyMap() : payload); }  JsonObject visitAndMap(final Collection<ParameterMeta> parameters, final Map<String, String> payload);  }