RemoteManager { public void loadRemotes() throws IOException { InputStream is = null; try { is = this.getClass().getResourceAsStream(REMOTES_FILE); loadRemotes(is); } finally { IOUtils.closeQuietly(is); } }  @PostConstruct void load(); void loadRemotes(); void loadKeySets(); void loadRemotes(InputStream is); void loadKeySets(InputStream is); Remote getRemote(String remoteType); Collection<Remote> getRemotes(); Set<String> getRemoteTypes(); Set<String> getKeySet(String remoteType); void addRemoteTypeToRemote(String remoteId, String remoteType); static final String DEFAULT_REMOTE_TYPE; static final String KEY_SETS_FILE; static final String REMOTES_FILE; }
@Test(expectedExceptions={RuntimeException.class}, dataProvider="testInvalidFormatData") public void testInvalidFormat(String remotesContents) throws IOException { RemoteManager rMan = new RemoteManager(); rMan.loadRemotes(new ByteArrayInputStream(remotesContents.getBytes())); }