@Test public void validateEmptyPasswordCredentialsErrorTest() { emptyPasswordCredentials = new AptoideCredentials("test@test.com", "", true, "", ""); result = credentialsValidator.validateFields(emptyPasswordCredentials); assertEquals(AccountValidationException.EMPTY_CODE, result); }
@Nullable @VisibleForTesting protected int validateFields(AptoideCredentials credentials) { if (isEmpty(credentials.getEmail()) && isEmpty(credentials.getCode())) { return AccountValidationException.EMPTY_EMAIL_AND_CODE; } else if (isEmpty(credentials.getCode())) { return AccountValidationException.EMPTY_CODE; } else if (isEmpty(credentials.getEmail())) { return AccountValidationException.EMPTY_EMAIL; } return -1; }
CredentialsValidator { @Nullable @VisibleForTesting protected int validateFields(AptoideCredentials credentials) { if (isEmpty(credentials.getEmail()) && isEmpty(credentials.getCode())) { return AccountValidationException.EMPTY_EMAIL_AND_CODE; } else if (isEmpty(credentials.getCode())) { return AccountValidationException.EMPTY_CODE; } else if (isEmpty(credentials.getEmail())) { return AccountValidationException.EMPTY_EMAIL; } return -1; } }
CredentialsValidator { @Nullable @VisibleForTesting protected int validateFields(AptoideCredentials credentials) { if (isEmpty(credentials.getEmail()) && isEmpty(credentials.getCode())) { return AccountValidationException.EMPTY_EMAIL_AND_CODE; } else if (isEmpty(credentials.getCode())) { return AccountValidationException.EMPTY_CODE; } else if (isEmpty(credentials.getEmail())) { return AccountValidationException.EMPTY_EMAIL; } return -1; }  }
CredentialsValidator { @Nullable @VisibleForTesting protected int validateFields(AptoideCredentials credentials) { if (isEmpty(credentials.getEmail()) && isEmpty(credentials.getCode())) { return AccountValidationException.EMPTY_EMAIL_AND_CODE; } else if (isEmpty(credentials.getCode())) { return AccountValidationException.EMPTY_CODE; } else if (isEmpty(credentials.getEmail())) { return AccountValidationException.EMPTY_EMAIL; } return -1; }  Completable validate(AptoideCredentials credentials); Single<Boolean> isEmailValid(String email); }
CredentialsValidator { @Nullable @VisibleForTesting protected int validateFields(AptoideCredentials credentials) { if (isEmpty(credentials.getEmail()) && isEmpty(credentials.getCode())) { return AccountValidationException.EMPTY_EMAIL_AND_CODE; } else if (isEmpty(credentials.getCode())) { return AccountValidationException.EMPTY_CODE; } else if (isEmpty(credentials.getEmail())) { return AccountValidationException.EMPTY_EMAIL; } return -1; }  Completable validate(AptoideCredentials credentials); Single<Boolean> isEmailValid(String email);  }