title: Unit Test OnSuccess in RxJava
body: <pre><code>public void onCreateAccountButtonClicked(Go99ApplicationconfigureApplication) {
      Log.i(TAG, " On create account button clicked");
  
      PasswordAndEmailValidator passwordAndEmailValidator = new PasswordAndEmailValidator();
      if (signUpView.getFirstName().isEmpty() || signUpView.getLastName().isEmpty() || signUpView.getEmailAddress().isEmpty() || signUpView.getPassword().isEmpty()
              || signUpView.getConfirmPassword().isEmpty()) {
          signUpView.showErrorMessage("Field empty");
          return;
      }
  
      if (!passwordAndEmailValidator.validatePassword(signUpView.getPassword())) {
          signUpView.showErrorMessage("Password must be a at least 6 characters long.");
          return;
      }
  
      if (!signUpView.getConfirmPassword().equals(signUpView.getPassword())) {
          signUpView.showErrorMessage("Passwords don't match");
          return;
      }
  
      RequestGSON requestGSON = new RequestGSON();
      requestGSON.setEmail(signUpView.getEmailAddress().replaceAll("\\s", "").toLowerCase());
      requestGSON.setFirstName(signUpView.getFirstName());
      requestGSON.setLastName(signUpView.getLastName());
      requestGSON.setPassword(signUpView.getPassword());
  
      creationService.createUser(requestGSON).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new SingleSubscriber&lt;RestResponse&gt;() {
  
          @Override
          public void onSuccess(RestResponse value) {
              Object data = value.getData();
              String dataString = gson.toJson(data);
              CreatedUserObjectData createdUserObjectData = gson.fromJson(dataString, CreatedUserObjectData.class);
              signUpView.login(configureApplication, createdUserObjectData.getUserId(), signUpView.getEmailAddress().toLowerCase().replaceAll("\\s", ""), signUpView.getPassword());
  
          }
  
          @Override
          public void onError(Throwable error) {
  
          }
      });
  
  }
  </code></pre>
  
  <p>I need to unit test this method. I am using Mockito. Please help me in testing the onSuccess() method as I'm using RxJava.</p>