@Test public void shouldModifyReportExecutionParametersField() throws Exception { ReportExecutionRequestOptions options = ReportExecutionRequestOptions.newRequest("/my/uri"); options.withParameters(Collections.singletonList(new ReportParameter("key", Collections.singleton("value")))); Gson gson = GsonFactory.create(); assertThat(gson.toJson(options), is("{\"reportUnitUri\":\"/my/uri\",\"parameters\":{\"reportParameter\":[{\"name\":\"key\",\"value\":[\"value\"]}]}}")); }
public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ReportExecutionRequestOptionsFactory()); gsonBuilder.registerTypeAdapterFactory(new DashboardComponentTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new JobSourceParamsWrapperTypeAdapterFactory()); return gsonBuilder.create(); }
GsonFactory { public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ReportExecutionRequestOptionsFactory()); gsonBuilder.registerTypeAdapterFactory(new DashboardComponentTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new JobSourceParamsWrapperTypeAdapterFactory()); return gsonBuilder.create(); } }
GsonFactory { public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ReportExecutionRequestOptionsFactory()); gsonBuilder.registerTypeAdapterFactory(new DashboardComponentTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new JobSourceParamsWrapperTypeAdapterFactory()); return gsonBuilder.create(); }  }
GsonFactory { public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ReportExecutionRequestOptionsFactory()); gsonBuilder.registerTypeAdapterFactory(new DashboardComponentTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new JobSourceParamsWrapperTypeAdapterFactory()); return gsonBuilder.create(); }  static Gson create(); }
GsonFactory { public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ReportExecutionRequestOptionsFactory()); gsonBuilder.registerTypeAdapterFactory(new DashboardComponentTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new JobSourceParamsWrapperTypeAdapterFactory()); return gsonBuilder.create(); }  static Gson create();  }