### Question:
UserClientRest extends BaseClientRest implements UserClient { @Override public void login(StreamObserver<Login> loginObserver) { LoginRequest loginRequest = new LoginRequest.Builder( connectionManager.getClientConfig().getUsername(), connectionManager.getClientConfig().getPassword()) .build(); String url = buildLoginUrl(); postRequest(url, loginRequest, loginObserver, new LoginReader()); } UserClientRest(ConnectionManager connectionManager); @Override void login(StreamObserver<Login> loginObserver); @Override void logout(StreamObserver<Logout> logoutObserver); @Override void getAccount(StreamObserver<Account> accountObserver); @Override void getBalance(StreamObserver<Balance> balanceObserver);  }### Answer:
@Test @DisplayName("POST login") void loginTest() throws IOException { when(clientConfig.getLoginUrl()).thenReturn("https: when(clientConfig.getUsername()).thenReturn("john_doe".toCharArray()); when(clientConfig.getPassword()).thenReturn("secret".toCharArray()); when(serializer.writeObjectAsString(any(LoginRequest.class))).thenReturn("{}"); StreamObserver<Login> streamObserver = (StreamObserver<Login>) mock(StreamObserver.class); unit.login(streamObserver); verify(httpClient).post(eq("https: }