@Test public void shouldEnableGsonExposeAnnotationField() throws Exception { GsonBuilder gsonBuilder = PowerMockito.mock(GsonBuilder.class); whenNew(GsonBuilder.class).withNoArguments().thenReturn(gsonBuilder); GsonFactory.create(); verify(gsonBuilder, times(1)).excludeFieldsWithoutExposeAnnotation(); }
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();  }