private Investor getZonkyProxy(final ProxyType proxyType, final RemoteResponse confirmationResponse, final Tenant auth) { switch (proxyType) { case SIMPLE: return Investor.build(auth); case CONFIRMING: final ConfirmationProvider cp = mock(ConfirmationProvider.class); when(cp.getId()).thenReturn("something"); switch (confirmationResponse) { case ACK: when(cp.requestConfirmation(any(), anyInt(), anyInt())).thenReturn(true); break; case NAK: when(cp.requestConfirmation(any(), anyInt(), anyInt())).thenReturn(false); break; default: throw new IllegalStateException(); } return Investor.build(auth, cp); default: throw new IllegalStateException(); } }