@Test public void getStatus_AccountNotExists_StatusNotCreated() throws Exception { mockWebServer.enqueue(new MockResponse() .setResponseCode(404) ); int status = getStatus(ACCOUNT_ID); assertThat(status, equalTo(AccountStatus.NOT_CREATED)); }
@AccountStatus int getStatus(@NonNull String accountId) throws OperationFailedException { try { getBalance(accountId); return AccountStatus.CREATED; } catch (AccountNotFoundException e) { return AccountStatus.NOT_CREATED; } }
AccountInfoRetriever { @AccountStatus int getStatus(@NonNull String accountId) throws OperationFailedException { try { getBalance(accountId); return AccountStatus.CREATED; } catch (AccountNotFoundException e) { return AccountStatus.NOT_CREATED; } } }
AccountInfoRetriever { @AccountStatus int getStatus(@NonNull String accountId) throws OperationFailedException { try { getBalance(accountId); return AccountStatus.CREATED; } catch (AccountNotFoundException e) { return AccountStatus.NOT_CREATED; } } AccountInfoRetriever(Server server); }
AccountInfoRetriever { @AccountStatus int getStatus(@NonNull String accountId) throws OperationFailedException { try { getBalance(accountId); return AccountStatus.CREATED; } catch (AccountNotFoundException e) { return AccountStatus.NOT_CREATED; } } AccountInfoRetriever(Server server);  }
AccountInfoRetriever { @AccountStatus int getStatus(@NonNull String accountId) throws OperationFailedException { try { getBalance(accountId); return AccountStatus.CREATED; } catch (AccountNotFoundException e) { return AccountStatus.NOT_CREATED; } } AccountInfoRetriever(Server server);   }