@Test public void testRegularWorks() throws IOException { InternalAPI api = InternalAPIFactory.create(5, clusterString); try { Account acct = api.fetchAccount("acDUSBABEK"); Assert.assertNotNull(acct); } catch (IOException ex) { if (ex instanceof ClusterException) { ClusterException clusterEx = (ClusterException) ex; for (Throwable err : clusterEx.getExceptions()) err.printStackTrace(); } else ex.printStackTrace(); Assert.fail(ex.getMessage()); } finally { shutdown(api); } }
@Test(expected = HttpResponseException.class) public void testRegularHttpError() throws IOException { InternalAPI api = InternalAPIFactory.create(1, clusterString); Account acct = api.fetchAccount("acBOGUS___"); shutdown(api); }