@Test @UseDataProvider("provideInvalidFromJson") public void invalidFromJson(final File json, final Class<?> cls, final Gson gson, final Class<Exception> expectedException) throws FileNotFoundException { this.thrown.expect(expectedException); Application.fromJson(json, cls, gson); }
public static <T> T fromJson(final File json, final Class<T> cls, final Gson gson) throws FileNotFoundException { checkNotNull(json); checkNotNull(cls); checkNotNull(gson); final Reader reader = new InputStreamReader(new FileInputStream(json), Charsets.UTF_8); return gson.fromJson(reader, cls); }
Application { public static <T> T fromJson(final File json, final Class<T> cls, final Gson gson) throws FileNotFoundException { checkNotNull(json); checkNotNull(cls); checkNotNull(gson); final Reader reader = new InputStreamReader(new FileInputStream(json), Charsets.UTF_8); return gson.fromJson(reader, cls); } }
Application { public static <T> T fromJson(final File json, final Class<T> cls, final Gson gson) throws FileNotFoundException { checkNotNull(json); checkNotNull(cls); checkNotNull(gson); final Reader reader = new InputStreamReader(new FileInputStream(json), Charsets.UTF_8); return gson.fromJson(reader, cls); } private  Application(); }
Application { public static <T> T fromJson(final File json, final Class<T> cls, final Gson gson) throws FileNotFoundException { checkNotNull(json); checkNotNull(cls); checkNotNull(gson); final Reader reader = new InputStreamReader(new FileInputStream(json), Charsets.UTF_8); return gson.fromJson(reader, cls); } private  Application(); static Cli cli(final String name, final GetOpt getopt, final String[] args); static URI getResource(final String resourceName); static T fromJson(final File json, final Class<T> cls, final Gson gson); static void exit(final int exitCode); }
Application { public static <T> T fromJson(final File json, final Class<T> cls, final Gson gson) throws FileNotFoundException { checkNotNull(json); checkNotNull(cls); checkNotNull(gson); final Reader reader = new InputStreamReader(new FileInputStream(json), Charsets.UTF_8); return gson.fromJson(reader, cls); } private  Application(); static Cli cli(final String name, final GetOpt getopt, final String[] args); static URI getResource(final String resourceName); static T fromJson(final File json, final Class<T> cls, final Gson gson); static void exit(final int exitCode); static final int TEST_SUCCESS; static final int TEST_ERROR; static final int TEST_CONFIG_ERROR; static final int TEST_SHUTDOWN_ERROR; static final String TEST_SUCCESS_MSG; }