Codota Logo
com.github.robozonky.api.confirmations
Code IndexAdd Codota to your IDE (free)

How to use com.github.robozonky.api.confirmations

Best Java code snippets using com.github.robozonky.api.confirmations (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
FileOutputStream f =
  • Codota IconFile file;new FileOutputStream(file)
  • Codota IconString name;new FileOutputStream(name)
  • Codota IconFile file;new FileOutputStream(file, true)
  • Smart code suggestions by Codota
}
origin: com.github.robozonky/robozonky-api

public char[] getPassword() {
  return RequestId.makeDefensiveCopy(password);
}
origin: com.github.robozonky/robozonky-cli

private static boolean notifyProvider(final RawLoan loan, final ConfirmationProvider zonkoid, final String username,
                   final char... secret) {
  final RequestId id = new RequestId(username, secret);
  return zonkoid.requestConfirmation(id, loan.getId(), 200);
}
origin: com.github.robozonky/robozonky-integration-zonkoid

private static HttpEntity getFormData(final RequestId requestId, final int loanId, final int amount)
    throws UnsupportedEncodingException {
  final List<NameValuePair> nvps = Arrays.asList(
      new BasicNameValuePair("clientApp", CLIENT_APP),
      new BasicNameValuePair("username", requestId.getUserId()),
      new BasicNameValuePair("loanId", String.valueOf(loanId)),
      new BasicNameValuePair("preferredAmount", String.valueOf(amount))
  );
  return new UrlEncodedFormEntity(nvps);
}
origin: RoboZonky/robozonky

@Test
void nullUsername() {
  assertThatThrownBy(() -> new RequestId(null))
      .isInstanceOf(IllegalArgumentException.class);
}
origin: RoboZonky/robozonky

@Test
void emptyPassword() {
  final String username = "user";
  final RequestId r = new RequestId(username);
  final SoftAssertions softly = new SoftAssertions();
  softly.assertThat(r.getUserId()).isSameAs(username);
  softly.assertThat(r.getPassword()).isEmpty();
  softly.assertAll();
}
origin: RoboZonky/robozonky

@Test
void passwordDefensivelyCopied() {
  final char[] password = "pass".toCharArray();
  final RequestId r = new RequestId("user", password);
  final SoftAssertions softly = new SoftAssertions();
  softly.assertThat(r.getPassword())
      .containsExactly(password)
      .isNotSameAs(password);
  softly.assertAll();
}
origin: RoboZonky/robozonky

static String getAuthenticationString(final RequestId requestId, final int loanId) {
  final String auth = new StringJoiner("|")
      .add(String.valueOf(requestId.getPassword()))
      .add(CLIENT_APP)
      .add(requestId.getUserId())
      .add(String.valueOf(loanId))
      .toString();
  try {
    return md5(auth);
  } catch (final NoSuchAlgorithmException ex) {
    throw new IllegalStateException("Your Java Runtime Environment does not support MD5!", ex);
  }
}
origin: com.github.robozonky/robozonky-common

static Optional<ConfirmationProvider> load(final String providerId,
                      final Iterable<ConfirmationProviderService> loader) {
  ConfirmationProviderLoader.LOGGER.debug("Looking up confirmation provider '{}'.", providerId);
  return StreamUtil.toStream(loader)
      .peek(cp -> ConfirmationProviderLoader.LOGGER.trace("Evaluating confirmation provider '{}' with '{}'.",
                                providerId, cp.getClass()))
      .map(cp -> cp.find(providerId))
      .flatMap(o -> o.map(Stream::of).orElse(Stream.empty()))
      .findFirst();
}
origin: RoboZonky/robozonky

private static boolean notifyProvider(final RawLoan loan, final ConfirmationProvider zonkoid, final String username,
                   final char... secret) {
  final RequestId id = new RequestId(username, secret);
  return zonkoid.requestConfirmation(id, loan.getId(), 200);
}
origin: RoboZonky/robozonky

@Test
void equalsSame() {
  final char[] password = "pass".toCharArray();
  final String username = "user";
  final RequestId r1 = new RequestId(username, password);
  assertThat(r1).isEqualTo(r1);
  final RequestId r2 = new RequestId(username, password);
  assertThat(r1).isEqualTo(r2);
}
origin: com.github.robozonky/robozonky-integration-zonkoid

static String getAuthenticationString(final RequestId requestId, final int loanId) {
  final String auth = new StringJoiner("|")
      .add(String.valueOf(requestId.getPassword()))
      .add(CLIENT_APP)
      .add(requestId.getUserId())
      .add(String.valueOf(loanId))
      .toString();
  try {
    return md5(auth);
  } catch (final NoSuchAlgorithmException ex) {
    throw new IllegalStateException("Your Java Runtime Environment does not support MD5!", ex);
  }
}
origin: RoboZonky/robozonky

private static HttpEntity getFormData(final RequestId requestId, final int loanId, final int amount)
    throws UnsupportedEncodingException {
  final List<NameValuePair> nvps = Arrays.asList(
      new BasicNameValuePair("clientApp", CLIENT_APP),
      new BasicNameValuePair("username", requestId.getUserId()),
      new BasicNameValuePair("loanId", String.valueOf(loanId)),
      new BasicNameValuePair("preferredAmount", String.valueOf(amount))
  );
  return new UrlEncodedFormEntity(nvps);
}
origin: RoboZonky/robozonky

public char[] getPassword() {
  return RequestId.makeDefensiveCopy(password);
}
origin: RoboZonky/robozonky

@Test
void notEqualsPassword() {
  final String username = "user";
  final RequestId r1 = new RequestId(username, UUID.randomUUID().toString().toCharArray());
  final RequestId r2 = new RequestId(username, UUID.randomUUID().toString().toCharArray());
  assertThat(r1).isNotEqualTo(r2);
}
origin: com.github.robozonky/robozonky-api

public RequestId(final String userId, final char... password) {
  if (userId == null) {
    throw new IllegalArgumentException("Username must not be null.");
  }
  this.userId = userId;
  this.password = RequestId.makeDefensiveCopy(password);
}
origin: RoboZonky/robozonky

@Test
void notEqualsUsername() {
  final char[] password = "password".toCharArray();
  final RequestId r1 = new RequestId(UUID.randomUUID().toString(), password);
  final RequestId r2 = new RequestId(UUID.randomUUID().toString(), password);
  assertThat(r1).isNotEqualTo(r2);
}
origin: RoboZonky/robozonky

public RequestId(final String userId, final char... password) {
  if (userId == null) {
    throw new IllegalArgumentException("Username must not be null.");
  }
  this.userId = userId;
  this.password = RequestId.makeDefensiveCopy(password);
}
origin: com.github.robozonky/robozonky-app

public static Investor build(final Tenant auth, final ConfirmationProvider provider, final char... password) {
  final InvestOperation o = auth.getSessionInfo().isDryRun() ?
      DRY_RUN :
      recommendedLoan -> invest(auth, recommendedLoan);
  if (provider == null) {
    return new Investor(o);
  } else {
    final RequestId r = new RequestId(auth.getSessionInfo().getUsername(), password);
    return new Investor(r, provider, o);
  }
}
origin: RoboZonky/robozonky

public static Investor build(final Tenant auth, final ConfirmationProvider provider, final char... password) {
  final InvestOperation o = auth.getSessionInfo().isDryRun() ?
      DRY_RUN :
      recommendedLoan -> invest(auth, recommendedLoan);
  if (provider == null) {
    return new Investor(o);
  } else {
    final RequestId r = new RequestId(auth.getSessionInfo().getUsername(), password);
    return new Investor(r, provider, o);
  }
}
origin: RoboZonky/robozonky

private boolean execute(final int code) {
  this.mockServerResponse(code);
  final RequestId id = new RequestId("user@somewhere.cz", "apitest".toCharArray());
  final ZonkoidConfirmationProvider zcp = new ZonkoidConfirmationProvider(serverUrl);
  final boolean result = zcp.requestConfirmation(id , 1, 200);
  this.verifyClientRequest();
  return result;
}
com.github.robozonky.api.confirmations

Most used classes

  • RequestId
    Identification of this instance of RoboZonky to the remote confirmation endpoint.
  • ConfirmationProvider
    Remote endpoint to provide confirmations on investments.
  • ConfirmationProviderService
    Use Java's ServiceLoader to load different confirmation providers.
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now