target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void mergeAndUpdateStatus() { StreamPayment trx = transactionBuilder() .status(StreamPaymentStatus.CLOSED_BY_STREAM) .build(); transactionManager.merge(trx); verify(mockRepo, times(1)).upsertAmounts(streamPaymentToEntityConverter.convert(trx)); verify(mockRepo, times(1)).updateStatus(trx.accountId(), trx.s... | @Override public void merge(StreamPayment streamPayment) { streamPaymentsRepository.upsertAmounts(streamPaymentToEntityConverter.convert(streamPayment)); streamPayment.sourceAddress().ifPresent(sourceAddress -> { streamPaymentsRepository.updateSourceAddress(streamPayment.accountId(), streamPayment.streamPaymentId(), so... | InDatabaseStreamPaymentManager implements StreamPaymentManager { @Override public void merge(StreamPayment streamPayment) { streamPaymentsRepository.upsertAmounts(streamPaymentToEntityConverter.convert(streamPayment)); streamPayment.sourceAddress().ifPresent(sourceAddress -> { streamPaymentsRepository.updateSourceAddre... | InDatabaseStreamPaymentManager implements StreamPaymentManager { @Override public void merge(StreamPayment streamPayment) { streamPaymentsRepository.upsertAmounts(streamPaymentToEntityConverter.convert(streamPayment)); streamPayment.sourceAddress().ifPresent(sourceAddress -> { streamPaymentsRepository.updateSourceAddre... | InDatabaseStreamPaymentManager implements StreamPaymentManager { @Override public void merge(StreamPayment streamPayment) { streamPaymentsRepository.upsertAmounts(streamPaymentToEntityConverter.convert(streamPayment)); streamPayment.sourceAddress().ifPresent(sourceAddress -> { streamPaymentsRepository.updateSourceAddre... | InDatabaseStreamPaymentManager implements StreamPaymentManager { @Override public void merge(StreamPayment streamPayment) { streamPaymentsRepository.upsertAmounts(streamPaymentToEntityConverter.convert(streamPayment)); streamPayment.sourceAddress().ifPresent(sourceAddress -> { streamPaymentsRepository.updateSourceAddre... |
@Test public void mergeAndUpdateSourceAddress() { InterledgerAddress source = InterledgerAddress.of("test.sender"); StreamPayment trx = transactionBuilder() .sourceAddress(source) .build(); transactionManager.merge(trx); verify(mockRepo, times(1)).upsertAmounts(streamPaymentToEntityConverter.convert(trx)); verify(mockR... | @Override public void merge(StreamPayment streamPayment) { streamPaymentsRepository.upsertAmounts(streamPaymentToEntityConverter.convert(streamPayment)); streamPayment.sourceAddress().ifPresent(sourceAddress -> { streamPaymentsRepository.updateSourceAddress(streamPayment.accountId(), streamPayment.streamPaymentId(), so... | InDatabaseStreamPaymentManager implements StreamPaymentManager { @Override public void merge(StreamPayment streamPayment) { streamPaymentsRepository.upsertAmounts(streamPaymentToEntityConverter.convert(streamPayment)); streamPayment.sourceAddress().ifPresent(sourceAddress -> { streamPaymentsRepository.updateSourceAddre... | InDatabaseStreamPaymentManager implements StreamPaymentManager { @Override public void merge(StreamPayment streamPayment) { streamPaymentsRepository.upsertAmounts(streamPaymentToEntityConverter.convert(streamPayment)); streamPayment.sourceAddress().ifPresent(sourceAddress -> { streamPaymentsRepository.updateSourceAddre... | InDatabaseStreamPaymentManager implements StreamPaymentManager { @Override public void merge(StreamPayment streamPayment) { streamPaymentsRepository.upsertAmounts(streamPaymentToEntityConverter.convert(streamPayment)); streamPayment.sourceAddress().ifPresent(sourceAddress -> { streamPaymentsRepository.updateSourceAddre... | InDatabaseStreamPaymentManager implements StreamPaymentManager { @Override public void merge(StreamPayment streamPayment) { streamPaymentsRepository.upsertAmounts(streamPaymentToEntityConverter.convert(streamPayment)); streamPayment.sourceAddress().ifPresent(sourceAddress -> { streamPaymentsRepository.updateSourceAddre... |
@Test public void mergeAndUpdateDeliveredDetails() { String assetCode = "XRP"; short assetScale = 9; StreamPayment trx = transactionBuilder() .deliveredAssetScale(assetScale) .deliveredAssetCode(assetCode) .build(); transactionManager.merge(trx); verify(mockRepo, times(1)).upsertAmounts(streamPaymentToEntityConverter.c... | @Override public void merge(StreamPayment streamPayment) { streamPaymentsRepository.upsertAmounts(streamPaymentToEntityConverter.convert(streamPayment)); streamPayment.sourceAddress().ifPresent(sourceAddress -> { streamPaymentsRepository.updateSourceAddress(streamPayment.accountId(), streamPayment.streamPaymentId(), so... | InDatabaseStreamPaymentManager implements StreamPaymentManager { @Override public void merge(StreamPayment streamPayment) { streamPaymentsRepository.upsertAmounts(streamPaymentToEntityConverter.convert(streamPayment)); streamPayment.sourceAddress().ifPresent(sourceAddress -> { streamPaymentsRepository.updateSourceAddre... | InDatabaseStreamPaymentManager implements StreamPaymentManager { @Override public void merge(StreamPayment streamPayment) { streamPaymentsRepository.upsertAmounts(streamPaymentToEntityConverter.convert(streamPayment)); streamPayment.sourceAddress().ifPresent(sourceAddress -> { streamPaymentsRepository.updateSourceAddre... | InDatabaseStreamPaymentManager implements StreamPaymentManager { @Override public void merge(StreamPayment streamPayment) { streamPaymentsRepository.upsertAmounts(streamPaymentToEntityConverter.convert(streamPayment)); streamPayment.sourceAddress().ifPresent(sourceAddress -> { streamPaymentsRepository.updateSourceAddre... | InDatabaseStreamPaymentManager implements StreamPaymentManager { @Override public void merge(StreamPayment streamPayment) { streamPaymentsRepository.upsertAmounts(streamPaymentToEntityConverter.convert(streamPayment)); streamPayment.sourceAddress().ifPresent(sourceAddress -> { streamPaymentsRepository.updateSourceAddre... |
@Test public void onLocalSettlementPaymentWithNullIdempotenceId() { expectedException.expect(NullPointerException.class); expectedException.expectMessage("idempotencyKey must not be null"); settlementService.onIncomingSettlementPayment(null, SETTLEMENT_ACCOUNT_ID, INCOMING_SETTLEMENT); } | @Override public SettlementQuantity onIncomingSettlementPayment( final String idempotencyKey, final SettlementEngineAccountId settlementEngineAccountId, final SettlementQuantity incomingSettlementInSettlementUnits ) { Objects.requireNonNull(idempotencyKey, "idempotencyKey must not be null"); Objects.requireNonNull(sett... | DefaultSettlementService implements SettlementService { @Override public SettlementQuantity onIncomingSettlementPayment( final String idempotencyKey, final SettlementEngineAccountId settlementEngineAccountId, final SettlementQuantity incomingSettlementInSettlementUnits ) { Objects.requireNonNull(idempotencyKey, "idempo... | DefaultSettlementService implements SettlementService { @Override public SettlementQuantity onIncomingSettlementPayment( final String idempotencyKey, final SettlementEngineAccountId settlementEngineAccountId, final SettlementQuantity incomingSettlementInSettlementUnits ) { Objects.requireNonNull(idempotencyKey, "idempo... | DefaultSettlementService implements SettlementService { @Override public SettlementQuantity onIncomingSettlementPayment( final String idempotencyKey, final SettlementEngineAccountId settlementEngineAccountId, final SettlementQuantity incomingSettlementInSettlementUnits ) { Objects.requireNonNull(idempotencyKey, "idempo... | DefaultSettlementService implements SettlementService { @Override public SettlementQuantity onIncomingSettlementPayment( final String idempotencyKey, final SettlementEngineAccountId settlementEngineAccountId, final SettlementQuantity incomingSettlementInSettlementUnits ) { Objects.requireNonNull(idempotencyKey, "idempo... |
@Test public void onLocalSettlementPaymentWithNullAccountId() { expectedException.expect(NullPointerException.class); expectedException.expectMessage("settlementEngineAccountId must not be null"); settlementService.onIncomingSettlementPayment(UUID.randomUUID().toString(), null, INCOMING_SETTLEMENT); } | @Override public SettlementQuantity onIncomingSettlementPayment( final String idempotencyKey, final SettlementEngineAccountId settlementEngineAccountId, final SettlementQuantity incomingSettlementInSettlementUnits ) { Objects.requireNonNull(idempotencyKey, "idempotencyKey must not be null"); Objects.requireNonNull(sett... | DefaultSettlementService implements SettlementService { @Override public SettlementQuantity onIncomingSettlementPayment( final String idempotencyKey, final SettlementEngineAccountId settlementEngineAccountId, final SettlementQuantity incomingSettlementInSettlementUnits ) { Objects.requireNonNull(idempotencyKey, "idempo... | DefaultSettlementService implements SettlementService { @Override public SettlementQuantity onIncomingSettlementPayment( final String idempotencyKey, final SettlementEngineAccountId settlementEngineAccountId, final SettlementQuantity incomingSettlementInSettlementUnits ) { Objects.requireNonNull(idempotencyKey, "idempo... | DefaultSettlementService implements SettlementService { @Override public SettlementQuantity onIncomingSettlementPayment( final String idempotencyKey, final SettlementEngineAccountId settlementEngineAccountId, final SettlementQuantity incomingSettlementInSettlementUnits ) { Objects.requireNonNull(idempotencyKey, "idempo... | DefaultSettlementService implements SettlementService { @Override public SettlementQuantity onIncomingSettlementPayment( final String idempotencyKey, final SettlementEngineAccountId settlementEngineAccountId, final SettlementQuantity incomingSettlementInSettlementUnits ) { Objects.requireNonNull(idempotencyKey, "idempo... |
@Test public void cleanupSpspUrlPathWithNullBlankEmpty() { assertThat(spspController.cleanupSpspUrlPath(null)).isEmpty(); assertThat(spspController.cleanupSpspUrlPath("")).isEmpty(); assertThat(spspController.cleanupSpspUrlPath(" ")).isEmpty(); assertThat(spspController.cleanupSpspUrlPath("/")).isEmpty(); } | @VisibleForTesting protected final Optional<String> cleanupSpspUrlPath(String spspUrlPath) { String cleanedUpSpspUrlPath = spspUrlPath; if (StringUtils.isBlank(cleanedUpSpspUrlPath) || StringUtils.equals(cleanedUpSpspUrlPath, "/")) { return Optional.empty(); } else { if (!cleanedUpSpspUrlPath.startsWith("/")) { cleaned... | SpspController { @VisibleForTesting protected final Optional<String> cleanupSpspUrlPath(String spspUrlPath) { String cleanedUpSpspUrlPath = spspUrlPath; if (StringUtils.isBlank(cleanedUpSpspUrlPath) || StringUtils.equals(cleanedUpSpspUrlPath, "/")) { return Optional.empty(); } else { if (!cleanedUpSpspUrlPath.startsWit... | SpspController { @VisibleForTesting protected final Optional<String> cleanupSpspUrlPath(String spspUrlPath) { String cleanedUpSpspUrlPath = spspUrlPath; if (StringUtils.isBlank(cleanedUpSpspUrlPath) || StringUtils.equals(cleanedUpSpspUrlPath, "/")) { return Optional.empty(); } else { if (!cleanedUpSpspUrlPath.startsWit... | SpspController { @VisibleForTesting protected final Optional<String> cleanupSpspUrlPath(String spspUrlPath) { String cleanedUpSpspUrlPath = spspUrlPath; if (StringUtils.isBlank(cleanedUpSpspUrlPath) || StringUtils.equals(cleanedUpSpspUrlPath, "/")) { return Optional.empty(); } else { if (!cleanedUpSpspUrlPath.startsWit... | SpspController { @VisibleForTesting protected final Optional<String> cleanupSpspUrlPath(String spspUrlPath) { String cleanedUpSpspUrlPath = spspUrlPath; if (StringUtils.isBlank(cleanedUpSpspUrlPath) || StringUtils.equals(cleanedUpSpspUrlPath, "/")) { return Optional.empty(); } else { if (!cleanedUpSpspUrlPath.startsWit... |
@Test public void onLocalSettlementPaymentWithNullQuantity() { expectedException.expect(NullPointerException.class); expectedException.expectMessage("incomingSettlementInSettlementUnits must not be null"); settlementService.onIncomingSettlementPayment(UUID.randomUUID().toString(), SETTLEMENT_ACCOUNT_ID, null); } | @Override public SettlementQuantity onIncomingSettlementPayment( final String idempotencyKey, final SettlementEngineAccountId settlementEngineAccountId, final SettlementQuantity incomingSettlementInSettlementUnits ) { Objects.requireNonNull(idempotencyKey, "idempotencyKey must not be null"); Objects.requireNonNull(sett... | DefaultSettlementService implements SettlementService { @Override public SettlementQuantity onIncomingSettlementPayment( final String idempotencyKey, final SettlementEngineAccountId settlementEngineAccountId, final SettlementQuantity incomingSettlementInSettlementUnits ) { Objects.requireNonNull(idempotencyKey, "idempo... | DefaultSettlementService implements SettlementService { @Override public SettlementQuantity onIncomingSettlementPayment( final String idempotencyKey, final SettlementEngineAccountId settlementEngineAccountId, final SettlementQuantity incomingSettlementInSettlementUnits ) { Objects.requireNonNull(idempotencyKey, "idempo... | DefaultSettlementService implements SettlementService { @Override public SettlementQuantity onIncomingSettlementPayment( final String idempotencyKey, final SettlementEngineAccountId settlementEngineAccountId, final SettlementQuantity incomingSettlementInSettlementUnits ) { Objects.requireNonNull(idempotencyKey, "idempo... | DefaultSettlementService implements SettlementService { @Override public SettlementQuantity onIncomingSettlementPayment( final String idempotencyKey, final SettlementEngineAccountId settlementEngineAccountId, final SettlementQuantity incomingSettlementInSettlementUnits ) { Objects.requireNonNull(idempotencyKey, "idempo... |
@Test public void onLocalSettlementPaymentWhenAccountNotFound() { expectedException.expect(InvalidAccountIdProblem.class); expectedException .expectMessage("AccountIds may only contain the following characters: 'a–z', '0–9', '-', '_', or '~'"); when(accountSettingsRepositoryMock.findBySettlementEngineAccountId(SETTLEME... | @Override public SettlementQuantity onIncomingSettlementPayment( final String idempotencyKey, final SettlementEngineAccountId settlementEngineAccountId, final SettlementQuantity incomingSettlementInSettlementUnits ) { Objects.requireNonNull(idempotencyKey, "idempotencyKey must not be null"); Objects.requireNonNull(sett... | DefaultSettlementService implements SettlementService { @Override public SettlementQuantity onIncomingSettlementPayment( final String idempotencyKey, final SettlementEngineAccountId settlementEngineAccountId, final SettlementQuantity incomingSettlementInSettlementUnits ) { Objects.requireNonNull(idempotencyKey, "idempo... | DefaultSettlementService implements SettlementService { @Override public SettlementQuantity onIncomingSettlementPayment( final String idempotencyKey, final SettlementEngineAccountId settlementEngineAccountId, final SettlementQuantity incomingSettlementInSettlementUnits ) { Objects.requireNonNull(idempotencyKey, "idempo... | DefaultSettlementService implements SettlementService { @Override public SettlementQuantity onIncomingSettlementPayment( final String idempotencyKey, final SettlementEngineAccountId settlementEngineAccountId, final SettlementQuantity incomingSettlementInSettlementUnits ) { Objects.requireNonNull(idempotencyKey, "idempo... | DefaultSettlementService implements SettlementService { @Override public SettlementQuantity onIncomingSettlementPayment( final String idempotencyKey, final SettlementEngineAccountId settlementEngineAccountId, final SettlementQuantity incomingSettlementInSettlementUnits ) { Objects.requireNonNull(idempotencyKey, "idempo... |
@Test public void onLocalSettlementPayment() { String idempotencyKey = UUID.randomUUID().toString(); final AccountSettings accountSettings = AccountSettings.builder() .accountId(ACCOUNT_ID) .accountRelationship(AccountRelationship.PEER) .assetCode("USD") .assetScale(9) .linkType(LoopbackLink.LINK_TYPE) .settlementEngin... | @Override public SettlementQuantity onIncomingSettlementPayment( final String idempotencyKey, final SettlementEngineAccountId settlementEngineAccountId, final SettlementQuantity incomingSettlementInSettlementUnits ) { Objects.requireNonNull(idempotencyKey, "idempotencyKey must not be null"); Objects.requireNonNull(sett... | DefaultSettlementService implements SettlementService { @Override public SettlementQuantity onIncomingSettlementPayment( final String idempotencyKey, final SettlementEngineAccountId settlementEngineAccountId, final SettlementQuantity incomingSettlementInSettlementUnits ) { Objects.requireNonNull(idempotencyKey, "idempo... | DefaultSettlementService implements SettlementService { @Override public SettlementQuantity onIncomingSettlementPayment( final String idempotencyKey, final SettlementEngineAccountId settlementEngineAccountId, final SettlementQuantity incomingSettlementInSettlementUnits ) { Objects.requireNonNull(idempotencyKey, "idempo... | DefaultSettlementService implements SettlementService { @Override public SettlementQuantity onIncomingSettlementPayment( final String idempotencyKey, final SettlementEngineAccountId settlementEngineAccountId, final SettlementQuantity incomingSettlementInSettlementUnits ) { Objects.requireNonNull(idempotencyKey, "idempo... | DefaultSettlementService implements SettlementService { @Override public SettlementQuantity onIncomingSettlementPayment( final String idempotencyKey, final SettlementEngineAccountId settlementEngineAccountId, final SettlementQuantity incomingSettlementInSettlementUnits ) { Objects.requireNonNull(idempotencyKey, "idempo... |
@Test(expected = NullPointerException.class) public void translateWithNullSourceQuantity() { try { NumberScalingUtils.translate(null, 1, 2); fail("Should have thrown an NPE"); } catch (NullPointerException e) { assertThat(e.getMessage()).isEqualTo("sourceAmount must not be null"); throw e; } } | public static BigInteger translate( final BigInteger sourceAmount, final int sourceScale, final int destinationScale ) { Objects.requireNonNull(sourceAmount, "sourceAmount must not be null"); Preconditions.checkArgument(sourceAmount.compareTo(BigInteger.ZERO) >= 0, "sourceAmount must be positive"); Preconditions.checkA... | NumberScalingUtils { public static BigInteger translate( final BigInteger sourceAmount, final int sourceScale, final int destinationScale ) { Objects.requireNonNull(sourceAmount, "sourceAmount must not be null"); Preconditions.checkArgument(sourceAmount.compareTo(BigInteger.ZERO) >= 0, "sourceAmount must be positive");... | NumberScalingUtils { public static BigInteger translate( final BigInteger sourceAmount, final int sourceScale, final int destinationScale ) { Objects.requireNonNull(sourceAmount, "sourceAmount must not be null"); Preconditions.checkArgument(sourceAmount.compareTo(BigInteger.ZERO) >= 0, "sourceAmount must be positive");... | NumberScalingUtils { public static BigInteger translate( final BigInteger sourceAmount, final int sourceScale, final int destinationScale ) { Objects.requireNonNull(sourceAmount, "sourceAmount must not be null"); Preconditions.checkArgument(sourceAmount.compareTo(BigInteger.ZERO) >= 0, "sourceAmount must be positive");... | NumberScalingUtils { public static BigInteger translate( final BigInteger sourceAmount, final int sourceScale, final int destinationScale ) { Objects.requireNonNull(sourceAmount, "sourceAmount must not be null"); Preconditions.checkArgument(sourceAmount.compareTo(BigInteger.ZERO) >= 0, "sourceAmount must be positive");... |
@Test(expected = IllegalArgumentException.class) public void translateWithNegativeSourceScale() { try { NumberScalingUtils.translate(BigInteger.ZERO, -11, 2); fail("Should have thrown an NPE"); } catch (NullPointerException e) { assertThat(e.getMessage()).isEqualTo("sourceScale must not be negative"); throw e; } } | public static BigInteger translate( final BigInteger sourceAmount, final int sourceScale, final int destinationScale ) { Objects.requireNonNull(sourceAmount, "sourceAmount must not be null"); Preconditions.checkArgument(sourceAmount.compareTo(BigInteger.ZERO) >= 0, "sourceAmount must be positive"); Preconditions.checkA... | NumberScalingUtils { public static BigInteger translate( final BigInteger sourceAmount, final int sourceScale, final int destinationScale ) { Objects.requireNonNull(sourceAmount, "sourceAmount must not be null"); Preconditions.checkArgument(sourceAmount.compareTo(BigInteger.ZERO) >= 0, "sourceAmount must be positive");... | NumberScalingUtils { public static BigInteger translate( final BigInteger sourceAmount, final int sourceScale, final int destinationScale ) { Objects.requireNonNull(sourceAmount, "sourceAmount must not be null"); Preconditions.checkArgument(sourceAmount.compareTo(BigInteger.ZERO) >= 0, "sourceAmount must be positive");... | NumberScalingUtils { public static BigInteger translate( final BigInteger sourceAmount, final int sourceScale, final int destinationScale ) { Objects.requireNonNull(sourceAmount, "sourceAmount must not be null"); Preconditions.checkArgument(sourceAmount.compareTo(BigInteger.ZERO) >= 0, "sourceAmount must be positive");... | NumberScalingUtils { public static BigInteger translate( final BigInteger sourceAmount, final int sourceScale, final int destinationScale ) { Objects.requireNonNull(sourceAmount, "sourceAmount must not be null"); Preconditions.checkArgument(sourceAmount.compareTo(BigInteger.ZERO) >= 0, "sourceAmount must be positive");... |
@Test(expected = IllegalArgumentException.class) public void translateWithNegativeDestinationScale() { try { NumberScalingUtils.translate(BigInteger.ZERO, 1, -1); fail("Should have thrown an NPE"); } catch (NullPointerException e) { assertThat(e.getMessage()).isEqualTo("destinationScale must not be negative"); throw e;... | public static BigInteger translate( final BigInteger sourceAmount, final int sourceScale, final int destinationScale ) { Objects.requireNonNull(sourceAmount, "sourceAmount must not be null"); Preconditions.checkArgument(sourceAmount.compareTo(BigInteger.ZERO) >= 0, "sourceAmount must be positive"); Preconditions.checkA... | NumberScalingUtils { public static BigInteger translate( final BigInteger sourceAmount, final int sourceScale, final int destinationScale ) { Objects.requireNonNull(sourceAmount, "sourceAmount must not be null"); Preconditions.checkArgument(sourceAmount.compareTo(BigInteger.ZERO) >= 0, "sourceAmount must be positive");... | NumberScalingUtils { public static BigInteger translate( final BigInteger sourceAmount, final int sourceScale, final int destinationScale ) { Objects.requireNonNull(sourceAmount, "sourceAmount must not be null"); Preconditions.checkArgument(sourceAmount.compareTo(BigInteger.ZERO) >= 0, "sourceAmount must be positive");... | NumberScalingUtils { public static BigInteger translate( final BigInteger sourceAmount, final int sourceScale, final int destinationScale ) { Objects.requireNonNull(sourceAmount, "sourceAmount must not be null"); Preconditions.checkArgument(sourceAmount.compareTo(BigInteger.ZERO) >= 0, "sourceAmount must be positive");... | NumberScalingUtils { public static BigInteger translate( final BigInteger sourceAmount, final int sourceScale, final int destinationScale ) { Objects.requireNonNull(sourceAmount, "sourceAmount must not be null"); Preconditions.checkArgument(sourceAmount.compareTo(BigInteger.ZERO) >= 0, "sourceAmount must be positive");... |
@Test public void translate() { assertThat(NumberScalingUtils.translate( sourceSettlementQuantity.amount(), sourceSettlementQuantity.scale(), expectedSettlementQuantity.scale() )).as(description).isEqualTo(expectedSettlementQuantity.amount()); } | public static BigInteger translate( final BigInteger sourceAmount, final int sourceScale, final int destinationScale ) { Objects.requireNonNull(sourceAmount, "sourceAmount must not be null"); Preconditions.checkArgument(sourceAmount.compareTo(BigInteger.ZERO) >= 0, "sourceAmount must be positive"); Preconditions.checkA... | NumberScalingUtils { public static BigInteger translate( final BigInteger sourceAmount, final int sourceScale, final int destinationScale ) { Objects.requireNonNull(sourceAmount, "sourceAmount must not be null"); Preconditions.checkArgument(sourceAmount.compareTo(BigInteger.ZERO) >= 0, "sourceAmount must be positive");... | NumberScalingUtils { public static BigInteger translate( final BigInteger sourceAmount, final int sourceScale, final int destinationScale ) { Objects.requireNonNull(sourceAmount, "sourceAmount must not be null"); Preconditions.checkArgument(sourceAmount.compareTo(BigInteger.ZERO) >= 0, "sourceAmount must be positive");... | NumberScalingUtils { public static BigInteger translate( final BigInteger sourceAmount, final int sourceScale, final int destinationScale ) { Objects.requireNonNull(sourceAmount, "sourceAmount must not be null"); Preconditions.checkArgument(sourceAmount.compareTo(BigInteger.ZERO) >= 0, "sourceAmount must be positive");... | NumberScalingUtils { public static BigInteger translate( final BigInteger sourceAmount, final int sourceScale, final int destinationScale ) { Objects.requireNonNull(sourceAmount, "sourceAmount must not be null"); Preconditions.checkArgument(sourceAmount.compareTo(BigInteger.ZERO) >= 0, "sourceAmount must be positive");... |
@Test public void accountUpdatedEventInvalidates() { accountSettingsLoadingCache._handleAccountUpdated( AccountUpdatedEvent.builder() .accountId(AccountId.of("ricketycricket")) .build() ); verify(accountSettingsCache, times(1)).invalidate(AccountId.of("ricketycricket")); } | @Subscribe @SuppressWarnings("PMD.UnusedPublicMethod") public void _handleAccountUpdated(AccountUpdatedEvent event) { this.accountSettingsCache.invalidate(event.accountId()); } | AccountSettingsLoadingCache implements AccountSettingsCache { @Subscribe @SuppressWarnings("PMD.UnusedPublicMethod") public void _handleAccountUpdated(AccountUpdatedEvent event) { this.accountSettingsCache.invalidate(event.accountId()); } } | AccountSettingsLoadingCache implements AccountSettingsCache { @Subscribe @SuppressWarnings("PMD.UnusedPublicMethod") public void _handleAccountUpdated(AccountUpdatedEvent event) { this.accountSettingsCache.invalidate(event.accountId()); } @VisibleForTesting AccountSettingsLoadingCache(final AccountSettingsRepository a... | AccountSettingsLoadingCache implements AccountSettingsCache { @Subscribe @SuppressWarnings("PMD.UnusedPublicMethod") public void _handleAccountUpdated(AccountUpdatedEvent event) { this.accountSettingsCache.invalidate(event.accountId()); } @VisibleForTesting AccountSettingsLoadingCache(final AccountSettingsRepository a... | AccountSettingsLoadingCache implements AccountSettingsCache { @Subscribe @SuppressWarnings("PMD.UnusedPublicMethod") public void _handleAccountUpdated(AccountUpdatedEvent event) { this.accountSettingsCache.invalidate(event.accountId()); } @VisibleForTesting AccountSettingsLoadingCache(final AccountSettingsRepository a... |
@Test public void trackIncomingPacketPrepared() { final Counter counter = PrometheusCollectors.incomingPackets; assertThat(sum(counter)).isEqualTo(0); for (int i = 0; i < 100; i++) { metricsService.trackIncomingPacketPrepared(accountSettings(), preparePacket()); assertThat(sum(counter, PacketStatusResult.PREPARED.name(... | @Override public void trackIncomingPacketPrepared(AccountSettings accountSettings, InterledgerPreparePacket preparePacket) { Objects.requireNonNull(accountSettings); Objects.requireNonNull(preparePacket); PrometheusCollectors.incomingPackets.labels( PacketStatusResult.PREPARED.name(), EMPTY_REJECT_CODE, accountSettings... | PrometheusMetricsService implements MetricsService { @Override public void trackIncomingPacketPrepared(AccountSettings accountSettings, InterledgerPreparePacket preparePacket) { Objects.requireNonNull(accountSettings); Objects.requireNonNull(preparePacket); PrometheusCollectors.incomingPackets.labels( PacketStatusResul... | PrometheusMetricsService implements MetricsService { @Override public void trackIncomingPacketPrepared(AccountSettings accountSettings, InterledgerPreparePacket preparePacket) { Objects.requireNonNull(accountSettings); Objects.requireNonNull(preparePacket); PrometheusCollectors.incomingPackets.labels( PacketStatusResul... | PrometheusMetricsService implements MetricsService { @Override public void trackIncomingPacketPrepared(AccountSettings accountSettings, InterledgerPreparePacket preparePacket) { Objects.requireNonNull(accountSettings); Objects.requireNonNull(preparePacket); PrometheusCollectors.incomingPackets.labels( PacketStatusResul... | PrometheusMetricsService implements MetricsService { @Override public void trackIncomingPacketPrepared(AccountSettings accountSettings, InterledgerPreparePacket preparePacket) { Objects.requireNonNull(accountSettings); Objects.requireNonNull(preparePacket); PrometheusCollectors.incomingPackets.labels( PacketStatusResul... |
@Test public void trackIncomingPacketFulfilled() { final Counter counter = PrometheusCollectors.incomingPackets; assertThat(sum(counter)).isEqualTo(0); for (int i = 0; i < 100; i++) { metricsService.trackIncomingPacketFulfilled(accountSettings(), fulfillPacket()); assertThat(sum(counter, PacketStatusResult.PREPARED.nam... | @Override public void trackIncomingPacketFulfilled( final AccountSettings accountSettings, final InterledgerFulfillPacket fulfillPacket ) { Objects.requireNonNull(accountSettings); Objects.requireNonNull(fulfillPacket); PrometheusCollectors.incomingPackets.labels( PacketStatusResult.FULFILLED.name(), EMPTY_REJECT_CODE,... | PrometheusMetricsService implements MetricsService { @Override public void trackIncomingPacketFulfilled( final AccountSettings accountSettings, final InterledgerFulfillPacket fulfillPacket ) { Objects.requireNonNull(accountSettings); Objects.requireNonNull(fulfillPacket); PrometheusCollectors.incomingPackets.labels( Pa... | PrometheusMetricsService implements MetricsService { @Override public void trackIncomingPacketFulfilled( final AccountSettings accountSettings, final InterledgerFulfillPacket fulfillPacket ) { Objects.requireNonNull(accountSettings); Objects.requireNonNull(fulfillPacket); PrometheusCollectors.incomingPackets.labels( Pa... | PrometheusMetricsService implements MetricsService { @Override public void trackIncomingPacketFulfilled( final AccountSettings accountSettings, final InterledgerFulfillPacket fulfillPacket ) { Objects.requireNonNull(accountSettings); Objects.requireNonNull(fulfillPacket); PrometheusCollectors.incomingPackets.labels( Pa... | PrometheusMetricsService implements MetricsService { @Override public void trackIncomingPacketFulfilled( final AccountSettings accountSettings, final InterledgerFulfillPacket fulfillPacket ) { Objects.requireNonNull(accountSettings); Objects.requireNonNull(fulfillPacket); PrometheusCollectors.incomingPackets.labels( Pa... |
@Test public void cleanupSpspUrlPathWithVariants() { assertThat(spspController.cleanupSpspUrlPath("p")).get().isEqualTo("/p"); assertThat(spspController.cleanupSpspUrlPath("/p")).get().isEqualTo("/p"); assertThat(spspController.cleanupSpspUrlPath("p/")).get().isEqualTo("/p"); assertThat(spspController.cleanupSpspUrlPat... | @VisibleForTesting protected final Optional<String> cleanupSpspUrlPath(String spspUrlPath) { String cleanedUpSpspUrlPath = spspUrlPath; if (StringUtils.isBlank(cleanedUpSpspUrlPath) || StringUtils.equals(cleanedUpSpspUrlPath, "/")) { return Optional.empty(); } else { if (!cleanedUpSpspUrlPath.startsWith("/")) { cleaned... | SpspController { @VisibleForTesting protected final Optional<String> cleanupSpspUrlPath(String spspUrlPath) { String cleanedUpSpspUrlPath = spspUrlPath; if (StringUtils.isBlank(cleanedUpSpspUrlPath) || StringUtils.equals(cleanedUpSpspUrlPath, "/")) { return Optional.empty(); } else { if (!cleanedUpSpspUrlPath.startsWit... | SpspController { @VisibleForTesting protected final Optional<String> cleanupSpspUrlPath(String spspUrlPath) { String cleanedUpSpspUrlPath = spspUrlPath; if (StringUtils.isBlank(cleanedUpSpspUrlPath) || StringUtils.equals(cleanedUpSpspUrlPath, "/")) { return Optional.empty(); } else { if (!cleanedUpSpspUrlPath.startsWit... | SpspController { @VisibleForTesting protected final Optional<String> cleanupSpspUrlPath(String spspUrlPath) { String cleanedUpSpspUrlPath = spspUrlPath; if (StringUtils.isBlank(cleanedUpSpspUrlPath) || StringUtils.equals(cleanedUpSpspUrlPath, "/")) { return Optional.empty(); } else { if (!cleanedUpSpspUrlPath.startsWit... | SpspController { @VisibleForTesting protected final Optional<String> cleanupSpspUrlPath(String spspUrlPath) { String cleanedUpSpspUrlPath = spspUrlPath; if (StringUtils.isBlank(cleanedUpSpspUrlPath) || StringUtils.equals(cleanedUpSpspUrlPath, "/")) { return Optional.empty(); } else { if (!cleanedUpSpspUrlPath.startsWit... |
@Test public void trackIncomingPacketRejected() { final Counter counter = PrometheusCollectors.incomingPackets; assertThat(sum(counter)).isEqualTo(0); for (int i = 0; i < 100; i++) { metricsService.trackIncomingPacketRejected(accountSettings(), rejectPacket()); assertThat(sum(counter, PacketStatusResult.PREPARED.name()... | @Override public void trackIncomingPacketRejected( final AccountSettings accountSettings, final InterledgerRejectPacket rejectPacket ) { Objects.requireNonNull(accountSettings); Objects.requireNonNull(rejectPacket); PrometheusCollectors.incomingPackets.labels( PacketStatusResult.REJECTED.name(), rejectPacket.getCode().... | PrometheusMetricsService implements MetricsService { @Override public void trackIncomingPacketRejected( final AccountSettings accountSettings, final InterledgerRejectPacket rejectPacket ) { Objects.requireNonNull(accountSettings); Objects.requireNonNull(rejectPacket); PrometheusCollectors.incomingPackets.labels( Packet... | PrometheusMetricsService implements MetricsService { @Override public void trackIncomingPacketRejected( final AccountSettings accountSettings, final InterledgerRejectPacket rejectPacket ) { Objects.requireNonNull(accountSettings); Objects.requireNonNull(rejectPacket); PrometheusCollectors.incomingPackets.labels( Packet... | PrometheusMetricsService implements MetricsService { @Override public void trackIncomingPacketRejected( final AccountSettings accountSettings, final InterledgerRejectPacket rejectPacket ) { Objects.requireNonNull(accountSettings); Objects.requireNonNull(rejectPacket); PrometheusCollectors.incomingPackets.labels( Packet... | PrometheusMetricsService implements MetricsService { @Override public void trackIncomingPacketRejected( final AccountSettings accountSettings, final InterledgerRejectPacket rejectPacket ) { Objects.requireNonNull(accountSettings); Objects.requireNonNull(rejectPacket); PrometheusCollectors.incomingPackets.labels( Packet... |
@Test public void trackIncomingPacketFailed() { final Counter counter = PrometheusCollectors.incomingPackets; assertThat(sum(counter)).isEqualTo(0); for (int i = 0; i < 100; i++) { metricsService.trackIncomingPacketFailed(accountSettings()); assertThat(sum(counter, PacketStatusResult.PREPARED.name())).isEqualTo(0); ass... | @Override public void trackIncomingPacketFailed(final AccountSettings accountSettings) { Objects.requireNonNull(accountSettings); PrometheusCollectors.incomingPackets.labels( PacketStatusResult.FAILED.name(), EMPTY_REJECT_CODE, accountSettings.accountId().value(), accountSettings.assetCode(), stringify(accountSettings.... | PrometheusMetricsService implements MetricsService { @Override public void trackIncomingPacketFailed(final AccountSettings accountSettings) { Objects.requireNonNull(accountSettings); PrometheusCollectors.incomingPackets.labels( PacketStatusResult.FAILED.name(), EMPTY_REJECT_CODE, accountSettings.accountId().value(), ac... | PrometheusMetricsService implements MetricsService { @Override public void trackIncomingPacketFailed(final AccountSettings accountSettings) { Objects.requireNonNull(accountSettings); PrometheusCollectors.incomingPackets.labels( PacketStatusResult.FAILED.name(), EMPTY_REJECT_CODE, accountSettings.accountId().value(), ac... | PrometheusMetricsService implements MetricsService { @Override public void trackIncomingPacketFailed(final AccountSettings accountSettings) { Objects.requireNonNull(accountSettings); PrometheusCollectors.incomingPackets.labels( PacketStatusResult.FAILED.name(), EMPTY_REJECT_CODE, accountSettings.accountId().value(), ac... | PrometheusMetricsService implements MetricsService { @Override public void trackIncomingPacketFailed(final AccountSettings accountSettings) { Objects.requireNonNull(accountSettings); PrometheusCollectors.incomingPackets.labels( PacketStatusResult.FAILED.name(), EMPTY_REJECT_CODE, accountSettings.accountId().value(), ac... |
@Test public void trackOutgoingPacketPrepared() { final Counter counter = PrometheusCollectors.outgoingPackets; assertThat(sum(counter)).isEqualTo(0); for (int i = 0; i < 100; i++) { metricsService.trackOutgoingPacketPrepared(accountSettings(), preparePacket()); assertThat(sum(counter, PacketStatusResult.PREPARED.name(... | @Override public void trackOutgoingPacketPrepared(AccountSettings accountSettings, InterledgerPreparePacket preparePacket) { Objects.requireNonNull(accountSettings); Objects.requireNonNull(preparePacket); PrometheusCollectors.outgoingPackets.labels( PacketStatusResult.PREPARED.name(), EMPTY_REJECT_CODE, accountSettings... | PrometheusMetricsService implements MetricsService { @Override public void trackOutgoingPacketPrepared(AccountSettings accountSettings, InterledgerPreparePacket preparePacket) { Objects.requireNonNull(accountSettings); Objects.requireNonNull(preparePacket); PrometheusCollectors.outgoingPackets.labels( PacketStatusResul... | PrometheusMetricsService implements MetricsService { @Override public void trackOutgoingPacketPrepared(AccountSettings accountSettings, InterledgerPreparePacket preparePacket) { Objects.requireNonNull(accountSettings); Objects.requireNonNull(preparePacket); PrometheusCollectors.outgoingPackets.labels( PacketStatusResul... | PrometheusMetricsService implements MetricsService { @Override public void trackOutgoingPacketPrepared(AccountSettings accountSettings, InterledgerPreparePacket preparePacket) { Objects.requireNonNull(accountSettings); Objects.requireNonNull(preparePacket); PrometheusCollectors.outgoingPackets.labels( PacketStatusResul... | PrometheusMetricsService implements MetricsService { @Override public void trackOutgoingPacketPrepared(AccountSettings accountSettings, InterledgerPreparePacket preparePacket) { Objects.requireNonNull(accountSettings); Objects.requireNonNull(preparePacket); PrometheusCollectors.outgoingPackets.labels( PacketStatusResul... |
@Test public void trackOutgoingPacketFulfilled() { final Counter counter = PrometheusCollectors.outgoingPackets; assertThat(sum(counter)).isEqualTo(0); for (int i = 0; i < 100; i++) { metricsService.trackOutgoingPacketFulfilled(accountSettings(), fulfillPacket()); assertThat(sum(counter, PacketStatusResult.PREPARED.nam... | @Override public void trackOutgoingPacketFulfilled( final AccountSettings accountSettings, final InterledgerFulfillPacket fulfillPacket ) { Objects.requireNonNull(accountSettings); Objects.requireNonNull(fulfillPacket); PrometheusCollectors.outgoingPackets.labels( PacketStatusResult.FULFILLED.name(), EMPTY_REJECT_CODE,... | PrometheusMetricsService implements MetricsService { @Override public void trackOutgoingPacketFulfilled( final AccountSettings accountSettings, final InterledgerFulfillPacket fulfillPacket ) { Objects.requireNonNull(accountSettings); Objects.requireNonNull(fulfillPacket); PrometheusCollectors.outgoingPackets.labels( Pa... | PrometheusMetricsService implements MetricsService { @Override public void trackOutgoingPacketFulfilled( final AccountSettings accountSettings, final InterledgerFulfillPacket fulfillPacket ) { Objects.requireNonNull(accountSettings); Objects.requireNonNull(fulfillPacket); PrometheusCollectors.outgoingPackets.labels( Pa... | PrometheusMetricsService implements MetricsService { @Override public void trackOutgoingPacketFulfilled( final AccountSettings accountSettings, final InterledgerFulfillPacket fulfillPacket ) { Objects.requireNonNull(accountSettings); Objects.requireNonNull(fulfillPacket); PrometheusCollectors.outgoingPackets.labels( Pa... | PrometheusMetricsService implements MetricsService { @Override public void trackOutgoingPacketFulfilled( final AccountSettings accountSettings, final InterledgerFulfillPacket fulfillPacket ) { Objects.requireNonNull(accountSettings); Objects.requireNonNull(fulfillPacket); PrometheusCollectors.outgoingPackets.labels( Pa... |
@Test public void trackOutgoingPacketRejected() { final Counter counter = PrometheusCollectors.outgoingPackets; assertThat(sum(counter)).isEqualTo(0); for (int i = 0; i < 100; i++) { metricsService.trackOutgoingPacketRejected(accountSettings(), rejectPacket()); assertThat(sum(counter, PacketStatusResult.PREPARED.name()... | @Override public void trackOutgoingPacketRejected( final AccountSettings accountSettings, final InterledgerRejectPacket rejectPacket ) { Objects.requireNonNull(accountSettings); Objects.requireNonNull(rejectPacket); PrometheusCollectors.outgoingPackets.labels( PacketStatusResult.REJECTED.name(), rejectPacket.getCode().... | PrometheusMetricsService implements MetricsService { @Override public void trackOutgoingPacketRejected( final AccountSettings accountSettings, final InterledgerRejectPacket rejectPacket ) { Objects.requireNonNull(accountSettings); Objects.requireNonNull(rejectPacket); PrometheusCollectors.outgoingPackets.labels( Packet... | PrometheusMetricsService implements MetricsService { @Override public void trackOutgoingPacketRejected( final AccountSettings accountSettings, final InterledgerRejectPacket rejectPacket ) { Objects.requireNonNull(accountSettings); Objects.requireNonNull(rejectPacket); PrometheusCollectors.outgoingPackets.labels( Packet... | PrometheusMetricsService implements MetricsService { @Override public void trackOutgoingPacketRejected( final AccountSettings accountSettings, final InterledgerRejectPacket rejectPacket ) { Objects.requireNonNull(accountSettings); Objects.requireNonNull(rejectPacket); PrometheusCollectors.outgoingPackets.labels( Packet... | PrometheusMetricsService implements MetricsService { @Override public void trackOutgoingPacketRejected( final AccountSettings accountSettings, final InterledgerRejectPacket rejectPacket ) { Objects.requireNonNull(accountSettings); Objects.requireNonNull(rejectPacket); PrometheusCollectors.outgoingPackets.labels( Packet... |
@Test public void trackOutgoingPacketFailed() { final Counter counter = PrometheusCollectors.outgoingPackets; assertThat(sum(counter)).isEqualTo(0); for (int i = 0; i < 100; i++) { metricsService.trackOutgoingPacketFailed(accountSettings()); assertThat(sum(counter, PacketStatusResult.PREPARED.name())).isEqualTo(0); ass... | @Override public void trackOutgoingPacketFailed(final AccountSettings accountSettings) { Objects.requireNonNull(accountSettings); PrometheusCollectors.outgoingPackets.labels( PacketStatusResult.FAILED.name(), EMPTY_REJECT_CODE, accountSettings.accountId().value(), accountSettings.assetCode(), stringify(accountSettings.... | PrometheusMetricsService implements MetricsService { @Override public void trackOutgoingPacketFailed(final AccountSettings accountSettings) { Objects.requireNonNull(accountSettings); PrometheusCollectors.outgoingPackets.labels( PacketStatusResult.FAILED.name(), EMPTY_REJECT_CODE, accountSettings.accountId().value(), ac... | PrometheusMetricsService implements MetricsService { @Override public void trackOutgoingPacketFailed(final AccountSettings accountSettings) { Objects.requireNonNull(accountSettings); PrometheusCollectors.outgoingPackets.labels( PacketStatusResult.FAILED.name(), EMPTY_REJECT_CODE, accountSettings.accountId().value(), ac... | PrometheusMetricsService implements MetricsService { @Override public void trackOutgoingPacketFailed(final AccountSettings accountSettings) { Objects.requireNonNull(accountSettings); PrometheusCollectors.outgoingPackets.labels( PacketStatusResult.FAILED.name(), EMPTY_REJECT_CODE, accountSettings.accountId().value(), ac... | PrometheusMetricsService implements MetricsService { @Override public void trackOutgoingPacketFailed(final AccountSettings accountSettings) { Objects.requireNonNull(accountSettings); PrometheusCollectors.outgoingPackets.labels( PacketStatusResult.FAILED.name(), EMPTY_REJECT_CODE, accountSettings.accountId().value(), ac... |
@Test public void trackNumRateLimitedPackets() { final Counter counter = PrometheusCollectors.rateLimitedPackets; assertThat(sum(counter)).isEqualTo(0); for (int i = 0; i < 100; i++) { metricsService.trackNumRateLimitedPackets(accountSettings()); assertThat(sum(counter)).isEqualTo(i + 1); } } | @Override public void trackNumRateLimitedPackets(final AccountSettings accountSettings) { Objects.requireNonNull(accountSettings); PrometheusCollectors.rateLimitedPackets.labels( accountSettings.accountId().value(), accountSettings.assetCode(), stringify(accountSettings.assetScale()) ).inc(); } | PrometheusMetricsService implements MetricsService { @Override public void trackNumRateLimitedPackets(final AccountSettings accountSettings) { Objects.requireNonNull(accountSettings); PrometheusCollectors.rateLimitedPackets.labels( accountSettings.accountId().value(), accountSettings.assetCode(), stringify(accountSetti... | PrometheusMetricsService implements MetricsService { @Override public void trackNumRateLimitedPackets(final AccountSettings accountSettings) { Objects.requireNonNull(accountSettings); PrometheusCollectors.rateLimitedPackets.labels( accountSettings.accountId().value(), accountSettings.assetCode(), stringify(accountSetti... | PrometheusMetricsService implements MetricsService { @Override public void trackNumRateLimitedPackets(final AccountSettings accountSettings) { Objects.requireNonNull(accountSettings); PrometheusCollectors.rateLimitedPackets.labels( accountSettings.accountId().value(), accountSettings.assetCode(), stringify(accountSetti... | PrometheusMetricsService implements MetricsService { @Override public void trackNumRateLimitedPackets(final AccountSettings accountSettings) { Objects.requireNonNull(accountSettings); PrometheusCollectors.rateLimitedPackets.labels( accountSettings.accountId().value(), accountSettings.assetCode(), stringify(accountSetti... |
@Test public void trackIncomingSettlementSucceeded() { final Counter counter = PrometheusCollectors.incomingSettlements; assertThat(sum(counter)).isEqualTo(0); for (int i = 0; i < 100; i++) { metricsService.trackIncomingSettlementSucceeded(incomingSettlementSucceededEvent()); assertThat(sum(counter)).isEqualTo(i + 1); ... | @Override public void trackIncomingSettlementSucceeded(IncomingSettlementSucceededEvent event) { Objects.requireNonNull(event); event.accountSettings().ifPresent(accountSettings -> PrometheusCollectors.incomingSettlements.labels( SETTLEMENT_SUCCEEDED, accountSettings.accountId().value(), accountSettings.assetCode(), ac... | PrometheusMetricsService implements MetricsService { @Override public void trackIncomingSettlementSucceeded(IncomingSettlementSucceededEvent event) { Objects.requireNonNull(event); event.accountSettings().ifPresent(accountSettings -> PrometheusCollectors.incomingSettlements.labels( SETTLEMENT_SUCCEEDED, accountSettings... | PrometheusMetricsService implements MetricsService { @Override public void trackIncomingSettlementSucceeded(IncomingSettlementSucceededEvent event) { Objects.requireNonNull(event); event.accountSettings().ifPresent(accountSettings -> PrometheusCollectors.incomingSettlements.labels( SETTLEMENT_SUCCEEDED, accountSettings... | PrometheusMetricsService implements MetricsService { @Override public void trackIncomingSettlementSucceeded(IncomingSettlementSucceededEvent event) { Objects.requireNonNull(event); event.accountSettings().ifPresent(accountSettings -> PrometheusCollectors.incomingSettlements.labels( SETTLEMENT_SUCCEEDED, accountSettings... | PrometheusMetricsService implements MetricsService { @Override public void trackIncomingSettlementSucceeded(IncomingSettlementSucceededEvent event) { Objects.requireNonNull(event); event.accountSettings().ifPresent(accountSettings -> PrometheusCollectors.incomingSettlements.labels( SETTLEMENT_SUCCEEDED, accountSettings... |
@Test public void trackIncomingSettlementFailed() { final Counter counter = PrometheusCollectors.incomingSettlements; assertThat(sum(counter)).isEqualTo(0); for (int i = 0; i < 100; i++) { metricsService.trackIncomingSettlementFailed(incomingSettlementFailedEvent()); assertThat(sum(counter)).isEqualTo(i + 1); assertTha... | @Override public void trackIncomingSettlementFailed(IncomingSettlementFailedEvent event) { Objects.requireNonNull(event); PrometheusCollectors.incomingSettlements.labels( SETTLEMENT_FAILED, event.requestedAccountId().value(), event.accountSettings().map(AccountSettings::assetCode).orElse(null), event.accountSettings().... | PrometheusMetricsService implements MetricsService { @Override public void trackIncomingSettlementFailed(IncomingSettlementFailedEvent event) { Objects.requireNonNull(event); PrometheusCollectors.incomingSettlements.labels( SETTLEMENT_FAILED, event.requestedAccountId().value(), event.accountSettings().map(AccountSettin... | PrometheusMetricsService implements MetricsService { @Override public void trackIncomingSettlementFailed(IncomingSettlementFailedEvent event) { Objects.requireNonNull(event); PrometheusCollectors.incomingSettlements.labels( SETTLEMENT_FAILED, event.requestedAccountId().value(), event.accountSettings().map(AccountSettin... | PrometheusMetricsService implements MetricsService { @Override public void trackIncomingSettlementFailed(IncomingSettlementFailedEvent event) { Objects.requireNonNull(event); PrometheusCollectors.incomingSettlements.labels( SETTLEMENT_FAILED, event.requestedAccountId().value(), event.accountSettings().map(AccountSettin... | PrometheusMetricsService implements MetricsService { @Override public void trackIncomingSettlementFailed(IncomingSettlementFailedEvent event) { Objects.requireNonNull(event); PrometheusCollectors.incomingSettlements.labels( SETTLEMENT_FAILED, event.requestedAccountId().value(), event.accountSettings().map(AccountSettin... |
@Test public void trackOutgoingSettlementInitiationSucceeded() { final Counter counter = PrometheusCollectors.outgoingSettlements; assertThat(sum(counter)).isEqualTo(0); for (int i = 0; i < 100; i++) { metricsService.trackOutgoingSettlementInitiationSucceeded(outgoingSettlementInitiationSucceededEvent()); assertThat(su... | @Override public void trackOutgoingSettlementInitiationSucceeded(final OutgoingSettlementInitiationSucceededEvent event) { Objects.requireNonNull(event); event.accountSettings().ifPresent(accountSettings -> PrometheusCollectors.outgoingSettlements.labels( SETTLEMENT_SUCCEEDED, accountSettings.accountId().value(), accou... | PrometheusMetricsService implements MetricsService { @Override public void trackOutgoingSettlementInitiationSucceeded(final OutgoingSettlementInitiationSucceededEvent event) { Objects.requireNonNull(event); event.accountSettings().ifPresent(accountSettings -> PrometheusCollectors.outgoingSettlements.labels( SETTLEMENT_... | PrometheusMetricsService implements MetricsService { @Override public void trackOutgoingSettlementInitiationSucceeded(final OutgoingSettlementInitiationSucceededEvent event) { Objects.requireNonNull(event); event.accountSettings().ifPresent(accountSettings -> PrometheusCollectors.outgoingSettlements.labels( SETTLEMENT_... | PrometheusMetricsService implements MetricsService { @Override public void trackOutgoingSettlementInitiationSucceeded(final OutgoingSettlementInitiationSucceededEvent event) { Objects.requireNonNull(event); event.accountSettings().ifPresent(accountSettings -> PrometheusCollectors.outgoingSettlements.labels( SETTLEMENT_... | PrometheusMetricsService implements MetricsService { @Override public void trackOutgoingSettlementInitiationSucceeded(final OutgoingSettlementInitiationSucceededEvent event) { Objects.requireNonNull(event); event.accountSettings().ifPresent(accountSettings -> PrometheusCollectors.outgoingSettlements.labels( SETTLEMENT_... |
@Test public void computePaymentTargetIntermediatePrefixWithNull() { expectedException.expect(NullPointerException.class); spspController.computePaymentTargetIntermediatePrefix(null); } | @VisibleForTesting protected final String computePaymentTargetIntermediatePrefix(final String requestUrlPath) { Objects.requireNonNull(requestUrlPath); String paymentTarget = this.spspUrlPath .map(spspUrlPath -> { if (!StringUtils.startsWith(requestUrlPath, spspUrlPath)) { return ""; } else { String returnable = String... | SpspController { @VisibleForTesting protected final String computePaymentTargetIntermediatePrefix(final String requestUrlPath) { Objects.requireNonNull(requestUrlPath); String paymentTarget = this.spspUrlPath .map(spspUrlPath -> { if (!StringUtils.startsWith(requestUrlPath, spspUrlPath)) { return ""; } else { String re... | SpspController { @VisibleForTesting protected final String computePaymentTargetIntermediatePrefix(final String requestUrlPath) { Objects.requireNonNull(requestUrlPath); String paymentTarget = this.spspUrlPath .map(spspUrlPath -> { if (!StringUtils.startsWith(requestUrlPath, spspUrlPath)) { return ""; } else { String re... | SpspController { @VisibleForTesting protected final String computePaymentTargetIntermediatePrefix(final String requestUrlPath) { Objects.requireNonNull(requestUrlPath); String paymentTarget = this.spspUrlPath .map(spspUrlPath -> { if (!StringUtils.startsWith(requestUrlPath, spspUrlPath)) { return ""; } else { String re... | SpspController { @VisibleForTesting protected final String computePaymentTargetIntermediatePrefix(final String requestUrlPath) { Objects.requireNonNull(requestUrlPath); String paymentTarget = this.spspUrlPath .map(spspUrlPath -> { if (!StringUtils.startsWith(requestUrlPath, spspUrlPath)) { return ""; } else { String re... |
@Test public void trackOutgoingSettlementInitiationFailed() { final Counter counter = PrometheusCollectors.outgoingSettlements; assertThat(sum(counter)).isEqualTo(0); for (int i = 0; i < 100; i++) { metricsService.trackOutgoingSettlementInitiationFailed(outgoingSettlementInitiationFailedEvent()); assertThat(sum(counter... | @Override public void trackOutgoingSettlementInitiationFailed(OutgoingSettlementInitiationFailedEvent event) { Objects.requireNonNull(event); event.accountSettings().ifPresent(accountSettings -> PrometheusCollectors.outgoingSettlements.labels( SETTLEMENT_FAILED, accountSettings.accountId().value(), accountSettings.asse... | PrometheusMetricsService implements MetricsService { @Override public void trackOutgoingSettlementInitiationFailed(OutgoingSettlementInitiationFailedEvent event) { Objects.requireNonNull(event); event.accountSettings().ifPresent(accountSettings -> PrometheusCollectors.outgoingSettlements.labels( SETTLEMENT_FAILED, acco... | PrometheusMetricsService implements MetricsService { @Override public void trackOutgoingSettlementInitiationFailed(OutgoingSettlementInitiationFailedEvent event) { Objects.requireNonNull(event); event.accountSettings().ifPresent(accountSettings -> PrometheusCollectors.outgoingSettlements.labels( SETTLEMENT_FAILED, acco... | PrometheusMetricsService implements MetricsService { @Override public void trackOutgoingSettlementInitiationFailed(OutgoingSettlementInitiationFailedEvent event) { Objects.requireNonNull(event); event.accountSettings().ifPresent(accountSettings -> PrometheusCollectors.outgoingSettlements.labels( SETTLEMENT_FAILED, acco... | PrometheusMetricsService implements MetricsService { @Override public void trackOutgoingSettlementInitiationFailed(OutgoingSettlementInitiationFailedEvent event) { Objects.requireNonNull(event); event.accountSettings().ifPresent(accountSettings -> PrometheusCollectors.outgoingSettlements.labels( SETTLEMENT_FAILED, acco... |
@Test public void toMonetaryAmountInvalidUnits() { final CurrencyUnit currencyUSD = Monetary.getCurrency("USD"); final int assetScale = 2; BigDecimal cents = BigDecimal.valueOf(0.1); assertThat( javaMoneyUtils.toMonetaryAmount(currencyUSD, cents.toBigInteger(), assetScale).getNumber().intValueExact()) .isEqualTo(0); } | public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } | JavaMoneyUtils { public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } } | JavaMoneyUtils { public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } } | JavaMoneyUtils { public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } MonetaryAmount toMonetaryAmount(
f... | JavaMoneyUtils { public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } MonetaryAmount toMonetaryAmount(
f... |
@Test public void toMonetaryAmountUSDToUSD() { final CurrencyUnit currencyUSD = Monetary.getCurrency("USD"); final int assetScale = 0; BigInteger cents = BigInteger.ZERO; assertThat(javaMoneyUtils.toMonetaryAmount(currencyUSD, cents, assetScale) .getNumber().numberValue(BigDecimal.class)).isEqualTo(new BigDecimal("0"))... | public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } | JavaMoneyUtils { public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } } | JavaMoneyUtils { public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } } | JavaMoneyUtils { public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } MonetaryAmount toMonetaryAmount(
f... | JavaMoneyUtils { public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } MonetaryAmount toMonetaryAmount(
f... |
@Test public void toMonetaryAmountCentsToUSD() { final CurrencyUnit currencyUSD = Monetary.getCurrency("USD"); final int assetScale = 2; BigInteger cents = BigInteger.ZERO; assertThat(javaMoneyUtils.toMonetaryAmount(currencyUSD, cents, assetScale) .getNumber().numberValue(BigDecimal.class)).isEqualTo(new BigDecimal("0"... | public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } | JavaMoneyUtils { public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } } | JavaMoneyUtils { public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } } | JavaMoneyUtils { public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } MonetaryAmount toMonetaryAmount(
f... | JavaMoneyUtils { public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } MonetaryAmount toMonetaryAmount(
f... |
@Test public void toMonetaryAmountNanoDollarsToUSD() { final CurrencyUnit currencyUSD = Monetary.getCurrency("USD"); final int assetScale = 9; BigInteger cents = BigInteger.ZERO; assertThat(javaMoneyUtils.toMonetaryAmount(currencyUSD, cents, assetScale) .getNumber().numberValue(BigDecimal.class)).isEqualTo(new BigDecim... | public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } | JavaMoneyUtils { public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } } | JavaMoneyUtils { public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } } | JavaMoneyUtils { public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } MonetaryAmount toMonetaryAmount(
f... | JavaMoneyUtils { public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } MonetaryAmount toMonetaryAmount(
f... |
@Test public void toMonetaryAmountDropsToXRP() { final CurrencyUnit currencyXRP = Monetary.getCurrency("XRP"); final int assetScale = 6; BigInteger cents = BigInteger.ZERO; assertThat(javaMoneyUtils.toMonetaryAmount(currencyXRP, cents, assetScale) .getNumber().numberValue(BigDecimal.class)).isEqualTo(new BigDecimal("0"... | public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } | JavaMoneyUtils { public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } } | JavaMoneyUtils { public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } } | JavaMoneyUtils { public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } MonetaryAmount toMonetaryAmount(
f... | JavaMoneyUtils { public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } MonetaryAmount toMonetaryAmount(
f... |
@Test public void toMonetaryAmountDropsToDrops() { final CurrencyUnit currencyXRP = Monetary.getCurrency("XRP"); final int assetScale = 9; BigInteger drops = BigInteger.ZERO; assertThat(javaMoneyUtils.toMonetaryAmount(currencyXRP, drops, assetScale) .getNumber().numberValue(BigDecimal.class)).isEqualTo(new BigDecimal("... | public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } | JavaMoneyUtils { public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } } | JavaMoneyUtils { public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } } | JavaMoneyUtils { public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } MonetaryAmount toMonetaryAmount(
f... | JavaMoneyUtils { public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } MonetaryAmount toMonetaryAmount(
f... |
@Test public void toMonetaryAmountXRPToXRP() { final CurrencyUnit currencyXRP = Monetary.getCurrency("XRP"); final int assetScale = 0; BigInteger cents = BigInteger.ZERO; assertThat(javaMoneyUtils.toMonetaryAmount(currencyXRP, cents, assetScale) .getNumber().numberValue(BigDecimal.class)).isEqualTo(new BigDecimal("0"))... | public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } | JavaMoneyUtils { public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } } | JavaMoneyUtils { public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } } | JavaMoneyUtils { public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } MonetaryAmount toMonetaryAmount(
f... | JavaMoneyUtils { public MonetaryAmount toMonetaryAmount( final CurrencyUnit currencyUnit, final BigInteger assetAmount, final int assetScale ) { final BigDecimal scaledAmount = BigDecimal.valueOf(assetAmount.longValue(), assetScale); return Money.of(scaledAmount, currencyUnit); } MonetaryAmount toMonetaryAmount(
f... |
@Test public void toInterledgerAmountUSDToUSD() { final CurrencyUnit currencyUSD = Monetary.getCurrency("USD"); final int assetScale = 0; Money money = Money.of(BigInteger.ZERO, currencyUSD); assertThat(javaMoneyUtils.toInterledgerAmount(money, assetScale)).isEqualTo(BigInteger.ZERO); money = Money.of(BigInteger.ONE, c... | public BigInteger toInterledgerAmount(MonetaryAmount monetaryAmount, int assetScale) { return monetaryAmount.scaleByPowerOfTen(assetScale).getNumber().numberValue(BigDecimal.class) .toBigInteger(); } | JavaMoneyUtils { public BigInteger toInterledgerAmount(MonetaryAmount monetaryAmount, int assetScale) { return monetaryAmount.scaleByPowerOfTen(assetScale).getNumber().numberValue(BigDecimal.class) .toBigInteger(); } } | JavaMoneyUtils { public BigInteger toInterledgerAmount(MonetaryAmount monetaryAmount, int assetScale) { return monetaryAmount.scaleByPowerOfTen(assetScale).getNumber().numberValue(BigDecimal.class) .toBigInteger(); } } | JavaMoneyUtils { public BigInteger toInterledgerAmount(MonetaryAmount monetaryAmount, int assetScale) { return monetaryAmount.scaleByPowerOfTen(assetScale).getNumber().numberValue(BigDecimal.class) .toBigInteger(); } MonetaryAmount toMonetaryAmount(
final CurrencyUnit currencyUnit, final BigInteger assetAmount, fi... | JavaMoneyUtils { public BigInteger toInterledgerAmount(MonetaryAmount monetaryAmount, int assetScale) { return monetaryAmount.scaleByPowerOfTen(assetScale).getNumber().numberValue(BigDecimal.class) .toBigInteger(); } MonetaryAmount toMonetaryAmount(
final CurrencyUnit currencyUnit, final BigInteger assetAmount, fi... |
@Test public void toInterledgerAmountDropsToDrops() { final CurrencyUnit currencyXRP = Monetary.getCurrency("XRP"); final int assetScale = 9; Money money = Money.of(BigInteger.ZERO, currencyXRP); assertThat(javaMoneyUtils.toInterledgerAmount(money, assetScale)).isEqualTo(BigInteger.ZERO); money = Money.of(BigInteger.va... | public BigInteger toInterledgerAmount(MonetaryAmount monetaryAmount, int assetScale) { return monetaryAmount.scaleByPowerOfTen(assetScale).getNumber().numberValue(BigDecimal.class) .toBigInteger(); } | JavaMoneyUtils { public BigInteger toInterledgerAmount(MonetaryAmount monetaryAmount, int assetScale) { return monetaryAmount.scaleByPowerOfTen(assetScale).getNumber().numberValue(BigDecimal.class) .toBigInteger(); } } | JavaMoneyUtils { public BigInteger toInterledgerAmount(MonetaryAmount monetaryAmount, int assetScale) { return monetaryAmount.scaleByPowerOfTen(assetScale).getNumber().numberValue(BigDecimal.class) .toBigInteger(); } } | JavaMoneyUtils { public BigInteger toInterledgerAmount(MonetaryAmount monetaryAmount, int assetScale) { return monetaryAmount.scaleByPowerOfTen(assetScale).getNumber().numberValue(BigDecimal.class) .toBigInteger(); } MonetaryAmount toMonetaryAmount(
final CurrencyUnit currencyUnit, final BigInteger assetAmount, fi... | JavaMoneyUtils { public BigInteger toInterledgerAmount(MonetaryAmount monetaryAmount, int assetScale) { return monetaryAmount.scaleByPowerOfTen(assetScale).getNumber().numberValue(BigDecimal.class) .toBigInteger(); } MonetaryAmount toMonetaryAmount(
final CurrencyUnit currencyUnit, final BigInteger assetAmount, fi... |
@Test public void computePaymentTargetIntermediatePrefix() { spspController = new SpspController(() -> connectorSettingsMock, streamReceiverMock, "/spsp"); assertThat(spspController.computePaymentTargetIntermediatePrefix("")).isEqualTo(""); assertThat(spspController.computePaymentTargetIntermediatePrefix(" ")).isEqualT... | @VisibleForTesting protected final String computePaymentTargetIntermediatePrefix(final String requestUrlPath) { Objects.requireNonNull(requestUrlPath); String paymentTarget = this.spspUrlPath .map(spspUrlPath -> { if (!StringUtils.startsWith(requestUrlPath, spspUrlPath)) { return ""; } else { String returnable = String... | SpspController { @VisibleForTesting protected final String computePaymentTargetIntermediatePrefix(final String requestUrlPath) { Objects.requireNonNull(requestUrlPath); String paymentTarget = this.spspUrlPath .map(spspUrlPath -> { if (!StringUtils.startsWith(requestUrlPath, spspUrlPath)) { return ""; } else { String re... | SpspController { @VisibleForTesting protected final String computePaymentTargetIntermediatePrefix(final String requestUrlPath) { Objects.requireNonNull(requestUrlPath); String paymentTarget = this.spspUrlPath .map(spspUrlPath -> { if (!StringUtils.startsWith(requestUrlPath, spspUrlPath)) { return ""; } else { String re... | SpspController { @VisibleForTesting protected final String computePaymentTargetIntermediatePrefix(final String requestUrlPath) { Objects.requireNonNull(requestUrlPath); String paymentTarget = this.spspUrlPath .map(spspUrlPath -> { if (!StringUtils.startsWith(requestUrlPath, spspUrlPath)) { return ""; } else { String re... | SpspController { @VisibleForTesting protected final String computePaymentTargetIntermediatePrefix(final String requestUrlPath) { Objects.requireNonNull(requestUrlPath); String paymentTarget = this.spspUrlPath .map(spspUrlPath -> { if (!StringUtils.startsWith(requestUrlPath, spspUrlPath)) { return ""; } else { String re... |
@Test public void toInterledgerAmountCentsToUSD() { final CurrencyUnit currencyUSD = Monetary.getCurrency("USD"); final int assetScale = 2; Money money = Money.of(new BigDecimal("0.0"), currencyUSD); assertThat(javaMoneyUtils.toInterledgerAmount(money, assetScale)).isEqualTo(BigInteger.ZERO); money = Money.of(new BigDe... | public BigInteger toInterledgerAmount(MonetaryAmount monetaryAmount, int assetScale) { return monetaryAmount.scaleByPowerOfTen(assetScale).getNumber().numberValue(BigDecimal.class) .toBigInteger(); } | JavaMoneyUtils { public BigInteger toInterledgerAmount(MonetaryAmount monetaryAmount, int assetScale) { return monetaryAmount.scaleByPowerOfTen(assetScale).getNumber().numberValue(BigDecimal.class) .toBigInteger(); } } | JavaMoneyUtils { public BigInteger toInterledgerAmount(MonetaryAmount monetaryAmount, int assetScale) { return monetaryAmount.scaleByPowerOfTen(assetScale).getNumber().numberValue(BigDecimal.class) .toBigInteger(); } } | JavaMoneyUtils { public BigInteger toInterledgerAmount(MonetaryAmount monetaryAmount, int assetScale) { return monetaryAmount.scaleByPowerOfTen(assetScale).getNumber().numberValue(BigDecimal.class) .toBigInteger(); } MonetaryAmount toMonetaryAmount(
final CurrencyUnit currencyUnit, final BigInteger assetAmount, fi... | JavaMoneyUtils { public BigInteger toInterledgerAmount(MonetaryAmount monetaryAmount, int assetScale) { return monetaryAmount.scaleByPowerOfTen(assetScale).getNumber().numberValue(BigDecimal.class) .toBigInteger(); } MonetaryAmount toMonetaryAmount(
final CurrencyUnit currencyUnit, final BigInteger assetAmount, fi... |
@Test public void toInterledgerNanoDollarsToUSD() { final CurrencyUnit currencyUSD = Monetary.getCurrency("USD"); final int assetScale = 9; Money money = Money.of(new BigDecimal("0.000000000"), currencyUSD); assertThat(javaMoneyUtils.toInterledgerAmount(money, assetScale)).isEqualTo(BigInteger.ZERO); money = Money.of(n... | public BigInteger toInterledgerAmount(MonetaryAmount monetaryAmount, int assetScale) { return monetaryAmount.scaleByPowerOfTen(assetScale).getNumber().numberValue(BigDecimal.class) .toBigInteger(); } | JavaMoneyUtils { public BigInteger toInterledgerAmount(MonetaryAmount monetaryAmount, int assetScale) { return monetaryAmount.scaleByPowerOfTen(assetScale).getNumber().numberValue(BigDecimal.class) .toBigInteger(); } } | JavaMoneyUtils { public BigInteger toInterledgerAmount(MonetaryAmount monetaryAmount, int assetScale) { return monetaryAmount.scaleByPowerOfTen(assetScale).getNumber().numberValue(BigDecimal.class) .toBigInteger(); } } | JavaMoneyUtils { public BigInteger toInterledgerAmount(MonetaryAmount monetaryAmount, int assetScale) { return monetaryAmount.scaleByPowerOfTen(assetScale).getNumber().numberValue(BigDecimal.class) .toBigInteger(); } MonetaryAmount toMonetaryAmount(
final CurrencyUnit currencyUnit, final BigInteger assetAmount, fi... | JavaMoneyUtils { public BigInteger toInterledgerAmount(MonetaryAmount monetaryAmount, int assetScale) { return monetaryAmount.scaleByPowerOfTen(assetScale).getNumber().numberValue(BigDecimal.class) .toBigInteger(); } MonetaryAmount toMonetaryAmount(
final CurrencyUnit currencyUnit, final BigInteger assetAmount, fi... |
@Test public void toInterledgerAmountDropsToXRP() { final CurrencyUnit currencyUSD = Monetary.getCurrency("XRP"); final int assetScale = 6; Money money = Money.of(new BigDecimal("0.00000000"), currencyUSD); assertThat(javaMoneyUtils.toInterledgerAmount(money, assetScale)).isEqualTo(BigInteger.ZERO); money = Money.of(ne... | public BigInteger toInterledgerAmount(MonetaryAmount monetaryAmount, int assetScale) { return monetaryAmount.scaleByPowerOfTen(assetScale).getNumber().numberValue(BigDecimal.class) .toBigInteger(); } | JavaMoneyUtils { public BigInteger toInterledgerAmount(MonetaryAmount monetaryAmount, int assetScale) { return monetaryAmount.scaleByPowerOfTen(assetScale).getNumber().numberValue(BigDecimal.class) .toBigInteger(); } } | JavaMoneyUtils { public BigInteger toInterledgerAmount(MonetaryAmount monetaryAmount, int assetScale) { return monetaryAmount.scaleByPowerOfTen(assetScale).getNumber().numberValue(BigDecimal.class) .toBigInteger(); } } | JavaMoneyUtils { public BigInteger toInterledgerAmount(MonetaryAmount monetaryAmount, int assetScale) { return monetaryAmount.scaleByPowerOfTen(assetScale).getNumber().numberValue(BigDecimal.class) .toBigInteger(); } MonetaryAmount toMonetaryAmount(
final CurrencyUnit currencyUnit, final BigInteger assetAmount, fi... | JavaMoneyUtils { public BigInteger toInterledgerAmount(MonetaryAmount monetaryAmount, int assetScale) { return monetaryAmount.scaleByPowerOfTen(assetScale).getNumber().numberValue(BigDecimal.class) .toBigInteger(); } MonetaryAmount toMonetaryAmount(
final CurrencyUnit currencyUnit, final BigInteger assetAmount, fi... |
@Test public void toInterledgerAmountXRPToXRP() { final CurrencyUnit currencyUSD = Monetary.getCurrency("XRP"); final int assetScale = 0; Money money = Money.of(BigInteger.ONE, currencyUSD); assertThat(javaMoneyUtils.toInterledgerAmount(money, assetScale)).isEqualTo(BigInteger.ONE); money = Money.of(BigInteger.valueOf(... | public BigInteger toInterledgerAmount(MonetaryAmount monetaryAmount, int assetScale) { return monetaryAmount.scaleByPowerOfTen(assetScale).getNumber().numberValue(BigDecimal.class) .toBigInteger(); } | JavaMoneyUtils { public BigInteger toInterledgerAmount(MonetaryAmount monetaryAmount, int assetScale) { return monetaryAmount.scaleByPowerOfTen(assetScale).getNumber().numberValue(BigDecimal.class) .toBigInteger(); } } | JavaMoneyUtils { public BigInteger toInterledgerAmount(MonetaryAmount monetaryAmount, int assetScale) { return monetaryAmount.scaleByPowerOfTen(assetScale).getNumber().numberValue(BigDecimal.class) .toBigInteger(); } } | JavaMoneyUtils { public BigInteger toInterledgerAmount(MonetaryAmount monetaryAmount, int assetScale) { return monetaryAmount.scaleByPowerOfTen(assetScale).getNumber().numberValue(BigDecimal.class) .toBigInteger(); } MonetaryAmount toMonetaryAmount(
final CurrencyUnit currencyUnit, final BigInteger assetAmount, fi... | JavaMoneyUtils { public BigInteger toInterledgerAmount(MonetaryAmount monetaryAmount, int assetScale) { return monetaryAmount.scaleByPowerOfTen(assetScale).getNumber().numberValue(BigDecimal.class) .toBigInteger(); } MonetaryAmount toMonetaryAmount(
final CurrencyUnit currencyUnit, final BigInteger assetAmount, fi... |
@Test public void exceptionWhenMissingAndMissing() { when(environmentMock.getProperty(ENABLED_PROTOCOLS + DOT + SPSP_ENABLED)).thenReturn(null); when(environmentMock.getProperty(ENABLED_FEATURES + DOT + LOCAL_SPSP_FULFILLMENT_ENABLED)).thenReturn(null); assertThat(condition.matches(contextMock, metadataMock)).isFalse()... | @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be disabled if `%s` is enabled", SPSP_ENABLED ); } if (... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... |
@Test public void matchesWhenMissingAndTrue() { when(environmentMock.getProperty(ENABLED_PROTOCOLS + DOT + SPSP_ENABLED)).thenReturn(null); when(environmentMock.getProperty(ENABLED_FEATURES + DOT + LOCAL_SPSP_FULFILLMENT_ENABLED)).thenReturn(TRUE); assertThat(condition.matches(contextMock, metadataMock)).isTrue(); } | @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be disabled if `%s` is enabled", SPSP_ENABLED ); } if (... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... |
@Test public void matchesWhenMissingAndFalse() { when(environmentMock.getProperty(ENABLED_PROTOCOLS + DOT + SPSP_ENABLED)).thenReturn(null); when(environmentMock.getProperty(ENABLED_FEATURES + DOT + LOCAL_SPSP_FULFILLMENT_ENABLED)).thenReturn(FALSE); assertThat(condition.matches(contextMock, metadataMock)).isFalse(); } | @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be disabled if `%s` is enabled", SPSP_ENABLED ); } if (... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... |
@Test public void exceptionWhenTrueAndMissing() { expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage(PRECONDITION_MESSAGE); when(environmentMock.getProperty(ENABLED_PROTOCOLS + DOT + SPSP_ENABLED)).thenReturn(TRUE); when(environmentMock.getProperty(ENABLED_FEATURES + DOT + LOCAL_S... | @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be disabled if `%s` is enabled", SPSP_ENABLED ); } if (... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... |
@Test public void matchesWhenTrueAndFalse() { expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage(PRECONDITION_MESSAGE); when(environmentMock.getProperty(ENABLED_PROTOCOLS + DOT + SPSP_ENABLED)).thenReturn(TRUE); when(environmentMock.getProperty(ENABLED_FEATURES + DOT + LOCAL_SPSP_... | @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be disabled if `%s` is enabled", SPSP_ENABLED ); } if (... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... |
@Test public void matchesWhenTrueAndTrue() { when(environmentMock.getProperty(ENABLED_PROTOCOLS + DOT + SPSP_ENABLED)).thenReturn(TRUE); when(environmentMock.getProperty(ENABLED_FEATURES + DOT + LOCAL_SPSP_FULFILLMENT_ENABLED)).thenReturn(TRUE); assertThat(condition.matches(contextMock, metadataMock)).isTrue(); } | @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be disabled if `%s` is enabled", SPSP_ENABLED ); } if (... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... |
@Test public void computePaymentTargetIntermediatePrefixWithOtherPath() { spspController = new SpspController(() -> connectorSettingsMock, streamReceiverMock, "/p"); assertThat(spspController.computePaymentTargetIntermediatePrefix("")).isEqualTo(""); assertThat(spspController.computePaymentTargetIntermediatePrefix(" ")... | @VisibleForTesting protected final String computePaymentTargetIntermediatePrefix(final String requestUrlPath) { Objects.requireNonNull(requestUrlPath); String paymentTarget = this.spspUrlPath .map(spspUrlPath -> { if (!StringUtils.startsWith(requestUrlPath, spspUrlPath)) { return ""; } else { String returnable = String... | SpspController { @VisibleForTesting protected final String computePaymentTargetIntermediatePrefix(final String requestUrlPath) { Objects.requireNonNull(requestUrlPath); String paymentTarget = this.spspUrlPath .map(spspUrlPath -> { if (!StringUtils.startsWith(requestUrlPath, spspUrlPath)) { return ""; } else { String re... | SpspController { @VisibleForTesting protected final String computePaymentTargetIntermediatePrefix(final String requestUrlPath) { Objects.requireNonNull(requestUrlPath); String paymentTarget = this.spspUrlPath .map(spspUrlPath -> { if (!StringUtils.startsWith(requestUrlPath, spspUrlPath)) { return ""; } else { String re... | SpspController { @VisibleForTesting protected final String computePaymentTargetIntermediatePrefix(final String requestUrlPath) { Objects.requireNonNull(requestUrlPath); String paymentTarget = this.spspUrlPath .map(spspUrlPath -> { if (!StringUtils.startsWith(requestUrlPath, spspUrlPath)) { return ""; } else { String re... | SpspController { @VisibleForTesting protected final String computePaymentTargetIntermediatePrefix(final String requestUrlPath) { Objects.requireNonNull(requestUrlPath); String paymentTarget = this.spspUrlPath .map(spspUrlPath -> { if (!StringUtils.startsWith(requestUrlPath, spspUrlPath)) { return ""; } else { String re... |
@Test public void exceptionWhenFalseAndMissing() { when(environmentMock.getProperty(ENABLED_PROTOCOLS + DOT + SPSP_ENABLED)).thenReturn(FALSE); when(environmentMock.getProperty(ENABLED_FEATURES + DOT + LOCAL_SPSP_FULFILLMENT_ENABLED)).thenReturn(null); assertThat(condition.matches(contextMock, metadataMock)).isFalse();... | @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be disabled if `%s` is enabled", SPSP_ENABLED ); } if (... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... |
@Test public void exceptionWhenFalseAndFalse() { when(environmentMock.getProperty(ENABLED_PROTOCOLS + DOT + SPSP_ENABLED)).thenReturn(FALSE); when(environmentMock.getProperty(ENABLED_FEATURES + DOT + LOCAL_SPSP_FULFILLMENT_ENABLED)).thenReturn(FALSE); assertThat(condition.matches(contextMock, metadataMock)).isFalse(); ... | @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be disabled if `%s` is enabled", SPSP_ENABLED ); } if (... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... |
@Test public void exceptionWhenFalseAndTrue() { when(environmentMock.getProperty(ENABLED_PROTOCOLS + DOT + SPSP_ENABLED)).thenReturn(FALSE); when(environmentMock.getProperty(ENABLED_FEATURES + DOT + LOCAL_SPSP_FULFILLMENT_ENABLED)).thenReturn(TRUE); assertThat(condition.matches(contextMock, metadataMock)).isTrue(); } | @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be disabled if `%s` is enabled", SPSP_ENABLED ); } if (... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... | SpspReceiverEnabledCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final Environment env = context.getEnvironment(); if (isSpspEnabled(env)) { Preconditions.checkArgument(isLocalSpspFulfillmentEnabled(env), "Local SPSP fulfillment may not be ... |
@Test public void resolveAccountIdWithNullLink() { expectedException.expect(NullPointerException.class); Link link = null; accountIdResolver.resolveAccountId(link); } | @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException("Disconnected Plugins do not have an associated account!", link.getLinkId()); } else { return AccountId.of(... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... |
@Test public void resolveAccountIdWithLink() { assertThat(accountIdResolver.resolveAccountId(linkMock)).isEqualTo(AccountId.of(LINK_ID.value())); } | @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException("Disconnected Plugins do not have an associated account!", link.getLinkId()); } else { return AccountId.of(... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... |
@Test public void resolveAccountIdWithStatefulLinkNotConnected() { when(statefulLinkMock.isConnected()).thenReturn(false); expectedException.expect(LinkNotConnectedException.class); accountIdResolver.resolveAccountId(statefulLinkMock); } | @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException("Disconnected Plugins do not have an associated account!", link.getLinkId()); } else { return AccountId.of(... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... |
@Test public void resolveAccountIdWithStatefulLinkConnected() { when(statefulLinkMock.isConnected()).thenReturn(true); accountIdResolver.resolveAccountId(statefulLinkMock); assertThat(accountIdResolver.resolveAccountId(statefulLinkMock)).isEqualTo(AccountId.of(LINK_ID.value())); } | @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException("Disconnected Plugins do not have an associated account!", link.getLinkId()); } else { return AccountId.of(... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... |
@Test public void testResolveAccountWithNullAuthentication() { expectedException.expect(NullPointerException.class); Authentication authentication = null; accountIdResolver.resolveAccountId(authentication); } | @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException("Disconnected Plugins do not have an associated account!", link.getLinkId()); } else { return AccountId.of(... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... |
@Test public void testResolveAccountWithAuthentication() { Authentication authenticationMock = mock(Authentication.class); when(authenticationMock.getPrincipal()).thenReturn("foo"); assertThat(accountIdResolver.resolveAccountId(authenticationMock)).isEqualTo(AccountId.of("foo")); } | @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException("Disconnected Plugins do not have an associated account!", link.getLinkId()); } else { return AccountId.of(... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... |
@Test public void testResolveAccountWithNullBtpSession() { expectedException.expect(NullPointerException.class); BtpSession btpSession = null; accountIdResolver.resolveAccountId(btpSession); } | @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException("Disconnected Plugins do not have an associated account!", link.getLinkId()); } else { return AccountId.of(... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... |
@Test public void computePaymentTargetIntermediatePrefixWithEmptySpspPath() { spspController = new SpspController(() -> connectorSettingsMock, streamReceiverMock, ""); assertThat(spspController.computePaymentTargetIntermediatePrefix("")).isEqualTo(""); assertThat(spspController.computePaymentTargetIntermediatePrefix(" ... | @VisibleForTesting protected final String computePaymentTargetIntermediatePrefix(final String requestUrlPath) { Objects.requireNonNull(requestUrlPath); String paymentTarget = this.spspUrlPath .map(spspUrlPath -> { if (!StringUtils.startsWith(requestUrlPath, spspUrlPath)) { return ""; } else { String returnable = String... | SpspController { @VisibleForTesting protected final String computePaymentTargetIntermediatePrefix(final String requestUrlPath) { Objects.requireNonNull(requestUrlPath); String paymentTarget = this.spspUrlPath .map(spspUrlPath -> { if (!StringUtils.startsWith(requestUrlPath, spspUrlPath)) { return ""; } else { String re... | SpspController { @VisibleForTesting protected final String computePaymentTargetIntermediatePrefix(final String requestUrlPath) { Objects.requireNonNull(requestUrlPath); String paymentTarget = this.spspUrlPath .map(spspUrlPath -> { if (!StringUtils.startsWith(requestUrlPath, spspUrlPath)) { return ""; } else { String re... | SpspController { @VisibleForTesting protected final String computePaymentTargetIntermediatePrefix(final String requestUrlPath) { Objects.requireNonNull(requestUrlPath); String paymentTarget = this.spspUrlPath .map(spspUrlPath -> { if (!StringUtils.startsWith(requestUrlPath, spspUrlPath)) { return ""; } else { String re... | SpspController { @VisibleForTesting protected final String computePaymentTargetIntermediatePrefix(final String requestUrlPath) { Objects.requireNonNull(requestUrlPath); String paymentTarget = this.spspUrlPath .map(spspUrlPath -> { if (!StringUtils.startsWith(requestUrlPath, spspUrlPath)) { return ""; } else { String re... |
@Test public void testResolveAccountWithBtpSessionWithNoCreds() { expectedException.expect(RuntimeException.class); expectedException.expectMessage("No BtpSessionCredentials found!"); BtpSession btpSessionMock = mock(BtpSession.class); Optional<BtpSessionCredentials> btpSessionCredentials = Optional.empty(); when(btpSe... | @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException("Disconnected Plugins do not have an associated account!", link.getLinkId()); } else { return AccountId.of(... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... |
@Test public void testResolveAccountWithBtpSessionWithNoAuthUsername() { expectedException.expect(RuntimeException.class); expectedException.expectMessage("Not yet implemented"); BtpSession btpSessionMock = mock(BtpSession.class); Optional<BtpSessionCredentials> btpSessionCredentials = Optional.of(BtpSessionCredentials... | @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException("Disconnected Plugins do not have an associated account!", link.getLinkId()); } else { return AccountId.of(... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... |
@Test public void testResolveAccountWithBtpSession() { BtpSession btpSessionMock = mock(BtpSession.class); Optional<BtpSessionCredentials> btpSessionCredentials = Optional.of(BtpSessionCredentials.builder() .authToken("authToken") .authUsername("authUsername") .build()); when(btpSessionMock.getBtpSessionCredentials()).... | @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException("Disconnected Plugins do not have an associated account!", link.getLinkId()); } else { return AccountId.of(... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... | DefaultAccountIdResolver implements BtpAccountIdResolver, IlpOverHttpAccountIdResolver, AccountIdResolver { @Override public AccountId resolveAccountId(final Link<?> link) { Objects.requireNonNull(link); if (link instanceof StatefulLink && !(((StatefulLink<?>) link).isConnected())) { throw new LinkNotConnectedException... |
@Test public void createToken() { AccountId accountId = AccountId.of("test"); AccessToken accessToken = manager.createToken(accountId); assertThat(accessToken.rawToken()).isNotEmpty(); assertThat(passwordEncoder.matches(accessToken.rawToken().get(), accessToken.encryptedToken())).isTrue(); } | @Override public AccessToken createToken(AccountId accountId) { String newRandomToken = Base64.getEncoder().encodeToString(UUID.randomUUID().toString().getBytes()); AccessTokenEntity newEntity = new AccessTokenEntity(); newEntity.setAccountId(accountId); newEntity.setEncryptedToken(encryptToken(newRandomToken)); Access... | DefaultAccessTokenManager implements AccessTokenManager { @Override public AccessToken createToken(AccountId accountId) { String newRandomToken = Base64.getEncoder().encodeToString(UUID.randomUUID().toString().getBytes()); AccessTokenEntity newEntity = new AccessTokenEntity(); newEntity.setAccountId(accountId); newEnti... | DefaultAccessTokenManager implements AccessTokenManager { @Override public AccessToken createToken(AccountId accountId) { String newRandomToken = Base64.getEncoder().encodeToString(UUID.randomUUID().toString().getBytes()); AccessTokenEntity newEntity = new AccessTokenEntity(); newEntity.setAccountId(accountId); newEnti... | DefaultAccessTokenManager implements AccessTokenManager { @Override public AccessToken createToken(AccountId accountId) { String newRandomToken = Base64.getEncoder().encodeToString(UUID.randomUUID().toString().getBytes()); AccessTokenEntity newEntity = new AccessTokenEntity(); newEntity.setAccountId(accountId); newEnti... | DefaultAccessTokenManager implements AccessTokenManager { @Override public AccessToken createToken(AccountId accountId) { String newRandomToken = Base64.getEncoder().encodeToString(UUID.randomUUID().toString().getBytes()); AccessTokenEntity newEntity = new AccessTokenEntity(); newEntity.setAccountId(accountId); newEnti... |
@Test public void failOnDupeSettlementEngineId() { AccountSettingsEntity entity = mock(AccountSettingsEntity.class); SettlementEngineDetailsEntity engineEntity = mock(SettlementEngineDetailsEntity.class); when(entity.getSettlementEngineDetailsEntity()).thenReturn(engineEntity); String daveandbusters = "daveandbusters";... | @VisibleForTesting protected AccountSettingsEntity persistAccountSettingsEntity(AccountSettingsEntity accountSettingsEntity) { AccountSettingsEntity entity; try { entity = this.accountSettingsRepository.save(accountSettingsEntity); } catch (Exception e) { if (e.getCause() instanceof ConstraintViolationException) { Cons... | DefaultAccountManager implements AccountManager { @VisibleForTesting protected AccountSettingsEntity persistAccountSettingsEntity(AccountSettingsEntity accountSettingsEntity) { AccountSettingsEntity entity; try { entity = this.accountSettingsRepository.save(accountSettingsEntity); } catch (Exception e) { if (e.getCause... | DefaultAccountManager implements AccountManager { @VisibleForTesting protected AccountSettingsEntity persistAccountSettingsEntity(AccountSettingsEntity accountSettingsEntity) { AccountSettingsEntity entity; try { entity = this.accountSettingsRepository.save(accountSettingsEntity); } catch (Exception e) { if (e.getCause... | DefaultAccountManager implements AccountManager { @VisibleForTesting protected AccountSettingsEntity persistAccountSettingsEntity(AccountSettingsEntity accountSettingsEntity) { AccountSettingsEntity entity; try { entity = this.accountSettingsRepository.save(accountSettingsEntity); } catch (Exception e) { if (e.getCause... | DefaultAccountManager implements AccountManager { @VisibleForTesting protected AccountSettingsEntity persistAccountSettingsEntity(AccountSettingsEntity accountSettingsEntity) { AccountSettingsEntity entity; try { entity = this.accountSettingsRepository.save(accountSettingsEntity); } catch (Exception e) { if (e.getCause... |
@Test public void validateLinkSettingsFailsOnInvalidLinkType() { AccountSettings accountSettings = AccountSettings.builder() .accountId(AccountId.of("UnsupportedLinkTypeGuy")) .assetCode("XRP") .assetScale(9) .linkType(LinkType.of("UnsupportedLinkType")) .accountRelationship(AccountRelationship.PEER) .build(); expected... | @Override public AccountSettings validateLinkSettings(AccountSettings accountSettings) { try { LinkSettings linkSettings = linkSettingsValidator .validateSettings(linkSettingsFactory.constructTyped(accountSettings)); if (accountSettings.linkType().equals(IlpOverHttpLink.LINK_TYPE)) { IlpOverHttpLinkSettings ilpOverHttp... | DefaultAccountManager implements AccountManager { @Override public AccountSettings validateLinkSettings(AccountSettings accountSettings) { try { LinkSettings linkSettings = linkSettingsValidator .validateSettings(linkSettingsFactory.constructTyped(accountSettings)); if (accountSettings.linkType().equals(IlpOverHttpLink... | DefaultAccountManager implements AccountManager { @Override public AccountSettings validateLinkSettings(AccountSettings accountSettings) { try { LinkSettings linkSettings = linkSettingsValidator .validateSettings(linkSettingsFactory.constructTyped(accountSettings)); if (accountSettings.linkType().equals(IlpOverHttpLink... | DefaultAccountManager implements AccountManager { @Override public AccountSettings validateLinkSettings(AccountSettings accountSettings) { try { LinkSettings linkSettings = linkSettingsValidator .validateSettings(linkSettingsFactory.constructTyped(accountSettings)); if (accountSettings.linkType().equals(IlpOverHttpLink... | DefaultAccountManager implements AccountManager { @Override public AccountSettings validateLinkSettings(AccountSettings accountSettings) { try { LinkSettings linkSettings = linkSettingsValidator .validateSettings(linkSettingsFactory.constructTyped(accountSettings)); if (accountSettings.linkType().equals(IlpOverHttpLink... |
@Test public void deleteAccount() { AccountId accountId = AccountId.of("egg"); final AccountSettings accountSettings = AccountSettings.builder() .accountId(accountId) .assetCode("XRP") .assetScale(9) .linkType(LinkType.of("Loopback")) .accountRelationship(AccountRelationship.PEER) .build(); AccountSettingsEntity accoun... | @Override @Transactional public void deleteByAccountId(AccountId accountId) { Optional<AccountSettingsEntity> entity = accountSettingsRepository.findByAccountId(accountId); if (!entity.isPresent()) { throw new AccountNotFoundProblem(accountId); } deletedAccountSettingsRepository.save(new DeletedAccountSettingsEntity(en... | DefaultAccountManager implements AccountManager { @Override @Transactional public void deleteByAccountId(AccountId accountId) { Optional<AccountSettingsEntity> entity = accountSettingsRepository.findByAccountId(accountId); if (!entity.isPresent()) { throw new AccountNotFoundProblem(accountId); } deletedAccountSettingsR... | DefaultAccountManager implements AccountManager { @Override @Transactional public void deleteByAccountId(AccountId accountId) { Optional<AccountSettingsEntity> entity = accountSettingsRepository.findByAccountId(accountId); if (!entity.isPresent()) { throw new AccountNotFoundProblem(accountId); } deletedAccountSettingsR... | DefaultAccountManager implements AccountManager { @Override @Transactional public void deleteByAccountId(AccountId accountId) { Optional<AccountSettingsEntity> entity = accountSettingsRepository.findByAccountId(accountId); if (!entity.isPresent()) { throw new AccountNotFoundProblem(accountId); } deletedAccountSettingsR... | DefaultAccountManager implements AccountManager { @Override @Transactional public void deleteByAccountId(AccountId accountId) { Optional<AccountSettingsEntity> entity = accountSettingsRepository.findByAccountId(accountId); if (!entity.isPresent()) { throw new AccountNotFoundProblem(accountId); } deletedAccountSettingsR... |
@Test public void deleteMissingAccountThrowsNotFound() { AccountId accountId = AccountId.of("egg"); when(accountSettingsRepository.findByAccountId(accountId)).thenReturn(Optional.empty()); expectedException.expect(AccountNotFoundProblem.class); accountManager.deleteByAccountId(accountId); } | @Override @Transactional public void deleteByAccountId(AccountId accountId) { Optional<AccountSettingsEntity> entity = accountSettingsRepository.findByAccountId(accountId); if (!entity.isPresent()) { throw new AccountNotFoundProblem(accountId); } deletedAccountSettingsRepository.save(new DeletedAccountSettingsEntity(en... | DefaultAccountManager implements AccountManager { @Override @Transactional public void deleteByAccountId(AccountId accountId) { Optional<AccountSettingsEntity> entity = accountSettingsRepository.findByAccountId(accountId); if (!entity.isPresent()) { throw new AccountNotFoundProblem(accountId); } deletedAccountSettingsR... | DefaultAccountManager implements AccountManager { @Override @Transactional public void deleteByAccountId(AccountId accountId) { Optional<AccountSettingsEntity> entity = accountSettingsRepository.findByAccountId(accountId); if (!entity.isPresent()) { throw new AccountNotFoundProblem(accountId); } deletedAccountSettingsR... | DefaultAccountManager implements AccountManager { @Override @Transactional public void deleteByAccountId(AccountId accountId) { Optional<AccountSettingsEntity> entity = accountSettingsRepository.findByAccountId(accountId); if (!entity.isPresent()) { throw new AccountNotFoundProblem(accountId); } deletedAccountSettingsR... | DefaultAccountManager implements AccountManager { @Override @Transactional public void deleteByAccountId(AccountId accountId) { Optional<AccountSettingsEntity> entity = accountSettingsRepository.findByAccountId(accountId); if (!entity.isPresent()) { throw new AccountNotFoundProblem(accountId); } deletedAccountSettingsR... |
@Test public void updateAccount() { AccountId accountId = AccountId.of("lloyd"); LinkType linkType = IlpOverHttpLink.LINK_TYPE; IlpOverHttpLinkSettings unvalidatedSettings = IlpOverHttpLinkSettings.builder() .incomingLinkSettings(mock(IncomingLinkSettings.class)) .outgoingLinkSettings(mock(OutgoingLinkSettings.class)) ... | @Override public AccountSettings updateAccount(final AccountId accountId, final AccountSettings accountSettings) { Objects.requireNonNull(accountId); Objects.requireNonNull(accountSettings); final AccountSettings updatedSettings = validateLinkSettings(accountSettings); return accountSettingsRepository.findByAccountId(a... | DefaultAccountManager implements AccountManager { @Override public AccountSettings updateAccount(final AccountId accountId, final AccountSettings accountSettings) { Objects.requireNonNull(accountId); Objects.requireNonNull(accountSettings); final AccountSettings updatedSettings = validateLinkSettings(accountSettings); ... | DefaultAccountManager implements AccountManager { @Override public AccountSettings updateAccount(final AccountId accountId, final AccountSettings accountSettings) { Objects.requireNonNull(accountId); Objects.requireNonNull(accountSettings); final AccountSettings updatedSettings = validateLinkSettings(accountSettings); ... | DefaultAccountManager implements AccountManager { @Override public AccountSettings updateAccount(final AccountId accountId, final AccountSettings accountSettings) { Objects.requireNonNull(accountId); Objects.requireNonNull(accountSettings); final AccountSettings updatedSettings = validateLinkSettings(accountSettings); ... | DefaultAccountManager implements AccountManager { @Override public AccountSettings updateAccount(final AccountId accountId, final AccountSettings accountSettings) { Objects.requireNonNull(accountId); Objects.requireNonNull(accountSettings); final AccountSettings updatedSettings = validateLinkSettings(accountSettings); ... |
@Test public void initializeParentAccountSettingsViaIlDcpWithModifiableConfig() { ModifiableConnectorSettings modifiableConnectorSettings = ModifiableConnectorSettings.create(); InterledgerAddress ildcpAddress = InterledgerAddress.of("g.parent.child"); AccountId accountId = simulateIldcp(modifiableConnectorSettings, il... | @Override public AccountSettings initializeParentAccountSettingsViaIlDcp(final AccountId accountId) { Objects.requireNonNull(accountId); final AccountSettingsEntity parentAccountSettingsEntity = accountSettingsRepository.safeFindByAccountId(accountId); final Link<?> link = this.getLinkManager().getOrCreateLink( convers... | DefaultAccountManager implements AccountManager { @Override public AccountSettings initializeParentAccountSettingsViaIlDcp(final AccountId accountId) { Objects.requireNonNull(accountId); final AccountSettingsEntity parentAccountSettingsEntity = accountSettingsRepository.safeFindByAccountId(accountId); final Link<?> lin... | DefaultAccountManager implements AccountManager { @Override public AccountSettings initializeParentAccountSettingsViaIlDcp(final AccountId accountId) { Objects.requireNonNull(accountId); final AccountSettingsEntity parentAccountSettingsEntity = accountSettingsRepository.safeFindByAccountId(accountId); final Link<?> lin... | DefaultAccountManager implements AccountManager { @Override public AccountSettings initializeParentAccountSettingsViaIlDcp(final AccountId accountId) { Objects.requireNonNull(accountId); final AccountSettingsEntity parentAccountSettingsEntity = accountSettingsRepository.safeFindByAccountId(accountId); final Link<?> lin... | DefaultAccountManager implements AccountManager { @Override public AccountSettings initializeParentAccountSettingsViaIlDcp(final AccountId accountId) { Objects.requireNonNull(accountId); final AccountSettingsEntity parentAccountSettingsEntity = accountSettingsRepository.safeFindByAccountId(accountId); final Link<?> lin... |
@Test public void getAllApplicationContexts() { assertThat(ApplicationContextProvider.findActiveContexts( Sets.newHashSet(mockContext(() -> false), mockContext(() -> false)))).hasSize(0); assertThat(ApplicationContextProvider.findActiveContexts( Sets.newHashSet(mockContext(() -> true), mockContext(() -> false)))).hasSi... | public static Set<ApplicationContext> getAllApplicationContexts() { return findActiveContexts(ctx); } | ApplicationContextProvider implements ApplicationContextAware { public static Set<ApplicationContext> getAllApplicationContexts() { return findActiveContexts(ctx); } } | ApplicationContextProvider implements ApplicationContextAware { public static Set<ApplicationContext> getAllApplicationContexts() { return findActiveContexts(ctx); } } | ApplicationContextProvider implements ApplicationContextAware { public static Set<ApplicationContext> getAllApplicationContexts() { return findActiveContexts(ctx); } static Set<ApplicationContext> getAllApplicationContexts(); void setApplicationContext(ApplicationContext ctx); } | ApplicationContextProvider implements ApplicationContextAware { public static Set<ApplicationContext> getAllApplicationContexts() { return findActiveContexts(ctx); } static Set<ApplicationContext> getAllApplicationContexts(); void setApplicationContext(ApplicationContext ctx); } |
@Test public void initializeParentAccountSettingsViaIlDcpWithPropertiesConfig() { ConnectorSettingsFromPropertyFile connectorSettingsFromPropertyFile = new ConnectorSettingsFromPropertyFile(); InterledgerAddress ildcpAddress = InterledgerAddress.of("g.parent.child"); AccountId accountId = simulateIldcp(connectorSetting... | @Override public AccountSettings initializeParentAccountSettingsViaIlDcp(final AccountId accountId) { Objects.requireNonNull(accountId); final AccountSettingsEntity parentAccountSettingsEntity = accountSettingsRepository.safeFindByAccountId(accountId); final Link<?> link = this.getLinkManager().getOrCreateLink( convers... | DefaultAccountManager implements AccountManager { @Override public AccountSettings initializeParentAccountSettingsViaIlDcp(final AccountId accountId) { Objects.requireNonNull(accountId); final AccountSettingsEntity parentAccountSettingsEntity = accountSettingsRepository.safeFindByAccountId(accountId); final Link<?> lin... | DefaultAccountManager implements AccountManager { @Override public AccountSettings initializeParentAccountSettingsViaIlDcp(final AccountId accountId) { Objects.requireNonNull(accountId); final AccountSettingsEntity parentAccountSettingsEntity = accountSettingsRepository.safeFindByAccountId(accountId); final Link<?> lin... | DefaultAccountManager implements AccountManager { @Override public AccountSettings initializeParentAccountSettingsViaIlDcp(final AccountId accountId) { Objects.requireNonNull(accountId); final AccountSettingsEntity parentAccountSettingsEntity = accountSettingsRepository.safeFindByAccountId(accountId); final Link<?> lin... | DefaultAccountManager implements AccountManager { @Override public AccountSettings initializeParentAccountSettingsViaIlDcp(final AccountId accountId) { Objects.requireNonNull(accountId); final AccountSettingsEntity parentAccountSettingsEntity = accountSettingsRepository.safeFindByAccountId(accountId); final Link<?> lin... |
@Test public void getDenomination() { assertThat(StreamPacketUtils.getDenomination(JUST_CONNECTION_ASSET_DETAILS_FRAME)).hasValue(DENOMINATION); assertThat(StreamPacketUtils.getDenomination(ALL_THE_FRAMES)).hasValue(DENOMINATION); assertThat(StreamPacketUtils.getDenomination(JUST_MONEY_FRAME)).isEmpty(); assertThat(Str... | public static Optional<Denomination> getDenomination(StreamPacket streamPacket) { return streamPacket.frames().stream() .filter(frame -> frame.streamFrameType().equals(StreamFrameType.ConnectionAssetDetails)) .map(frame -> ((ConnectionAssetDetailsFrame) frame)) .map(ConnectionAssetDetailsFrame::sourceDenomination) .fin... | StreamPacketUtils { public static Optional<Denomination> getDenomination(StreamPacket streamPacket) { return streamPacket.frames().stream() .filter(frame -> frame.streamFrameType().equals(StreamFrameType.ConnectionAssetDetails)) .map(frame -> ((ConnectionAssetDetailsFrame) frame)) .map(ConnectionAssetDetailsFrame::sour... | StreamPacketUtils { public static Optional<Denomination> getDenomination(StreamPacket streamPacket) { return streamPacket.frames().stream() .filter(frame -> frame.streamFrameType().equals(StreamFrameType.ConnectionAssetDetails)) .map(frame -> ((ConnectionAssetDetailsFrame) frame)) .map(ConnectionAssetDetailsFrame::sour... | StreamPacketUtils { public static Optional<Denomination> getDenomination(StreamPacket streamPacket) { return streamPacket.frames().stream() .filter(frame -> frame.streamFrameType().equals(StreamFrameType.ConnectionAssetDetails)) .map(frame -> ((ConnectionAssetDetailsFrame) frame)) .map(ConnectionAssetDetailsFrame::sour... | StreamPacketUtils { public static Optional<Denomination> getDenomination(StreamPacket streamPacket) { return streamPacket.frames().stream() .filter(frame -> frame.streamFrameType().equals(StreamFrameType.ConnectionAssetDetails)) .map(frame -> ((ConnectionAssetDetailsFrame) frame)) .map(ConnectionAssetDetailsFrame::sour... |
@Test public void hasCloseFrame() { assertThat(StreamPacketUtils.hasCloseFrame(JUST_CLOSE_FRAME)).isTrue(); assertThat(StreamPacketUtils.hasCloseFrame(ALL_THE_FRAMES)).isTrue(); assertThat(StreamPacketUtils.hasCloseFrame(JUST_MONEY_FRAME)).isFalse(); assertThat(StreamPacketUtils.hasCloseFrame(NO_FRAMES)).isFalse(); } | public static boolean hasCloseFrame(StreamPacket streamPacket) { return streamPacket.frames().stream() .map(StreamFrame::streamFrameType) .anyMatch(CLOSING_FRAMES::contains); } | StreamPacketUtils { public static boolean hasCloseFrame(StreamPacket streamPacket) { return streamPacket.frames().stream() .map(StreamFrame::streamFrameType) .anyMatch(CLOSING_FRAMES::contains); } } | StreamPacketUtils { public static boolean hasCloseFrame(StreamPacket streamPacket) { return streamPacket.frames().stream() .map(StreamFrame::streamFrameType) .anyMatch(CLOSING_FRAMES::contains); } } | StreamPacketUtils { public static boolean hasCloseFrame(StreamPacket streamPacket) { return streamPacket.frames().stream() .map(StreamFrame::streamFrameType) .anyMatch(CLOSING_FRAMES::contains); } static Optional<Denomination> getDenomination(StreamPacket streamPacket); static boolean hasCloseFrame(StreamPacket stream... | StreamPacketUtils { public static boolean hasCloseFrame(StreamPacket streamPacket) { return streamPacket.frames().stream() .map(StreamFrame::streamFrameType) .anyMatch(CLOSING_FRAMES::contains); } static Optional<Denomination> getDenomination(StreamPacket streamPacket); static boolean hasCloseFrame(StreamPacket stream... |
@Test public void getSourceAddress() { assertThat(StreamPacketUtils.getSourceAddress(JUST_CONNECTION_NEW_ADDRESS_FRAME)).hasValue(ADDRESS); assertThat(StreamPacketUtils.getSourceAddress(ALL_THE_FRAMES)).hasValue(ADDRESS); assertThat(StreamPacketUtils.getSourceAddress(JUST_MONEY_FRAME)).isEmpty(); assertThat(StreamPacke... | public static Optional<InterledgerAddress> getSourceAddress(StreamPacket streamPacket) { return streamPacket.frames().stream() .filter(frame -> frame.streamFrameType().equals(StreamFrameType.ConnectionNewAddress)) .map(frame -> ((ConnectionNewAddressFrame) frame).sourceAddress()) .filter(Optional::isPresent) .map(Optio... | StreamPacketUtils { public static Optional<InterledgerAddress> getSourceAddress(StreamPacket streamPacket) { return streamPacket.frames().stream() .filter(frame -> frame.streamFrameType().equals(StreamFrameType.ConnectionNewAddress)) .map(frame -> ((ConnectionNewAddressFrame) frame).sourceAddress()) .filter(Optional::i... | StreamPacketUtils { public static Optional<InterledgerAddress> getSourceAddress(StreamPacket streamPacket) { return streamPacket.frames().stream() .filter(frame -> frame.streamFrameType().equals(StreamFrameType.ConnectionNewAddress)) .map(frame -> ((ConnectionNewAddressFrame) frame).sourceAddress()) .filter(Optional::i... | StreamPacketUtils { public static Optional<InterledgerAddress> getSourceAddress(StreamPacket streamPacket) { return streamPacket.frames().stream() .filter(frame -> frame.streamFrameType().equals(StreamFrameType.ConnectionNewAddress)) .map(frame -> ((ConnectionNewAddressFrame) frame).sourceAddress()) .filter(Optional::i... | StreamPacketUtils { public static Optional<InterledgerAddress> getSourceAddress(StreamPacket streamPacket) { return streamPacket.frames().stream() .filter(frame -> frame.streamFrameType().equals(StreamFrameType.ConnectionNewAddress)) .map(frame -> ((ConnectionNewAddressFrame) frame).sourceAddress()) .filter(Optional::i... |
@Test public void publishFulfillment() { AccountSettings incomingAccount = AccountSettings.builder() .accountId(AccountId.of("hugh_honey")) .accountRelationship(AccountRelationship.PEER) .assetScale(9) .assetCode("XRP") .linkType(IlpOverHttpLink.LINK_TYPE) .build(); AccountSettings destinationAccount = AccountSettings.... | @Override public void publish(PacketFullfillmentEvent event) { logger.debug("Received fulfillment"); fulfillmentTopic.ifPresent(topicName -> { try { GcpPacketResponseEvent gcpFulfillmentEvent = mapFulfillment(event); String payload = mapper.writerFor(GcpPacketResponseEvent.class).writeValueAsString(gcpFulfillmentEvent)... | DefaultGcpPacketResponseEventPublisher implements GcpPacketResponseEventPublisher { @Override public void publish(PacketFullfillmentEvent event) { logger.debug("Received fulfillment"); fulfillmentTopic.ifPresent(topicName -> { try { GcpPacketResponseEvent gcpFulfillmentEvent = mapFulfillment(event); String payload = ma... | DefaultGcpPacketResponseEventPublisher implements GcpPacketResponseEventPublisher { @Override public void publish(PacketFullfillmentEvent event) { logger.debug("Received fulfillment"); fulfillmentTopic.ifPresent(topicName -> { try { GcpPacketResponseEvent gcpFulfillmentEvent = mapFulfillment(event); String payload = ma... | DefaultGcpPacketResponseEventPublisher implements GcpPacketResponseEventPublisher { @Override public void publish(PacketFullfillmentEvent event) { logger.debug("Received fulfillment"); fulfillmentTopic.ifPresent(topicName -> { try { GcpPacketResponseEvent gcpFulfillmentEvent = mapFulfillment(event); String payload = ma... | DefaultGcpPacketResponseEventPublisher implements GcpPacketResponseEventPublisher { @Override public void publish(PacketFullfillmentEvent event) { logger.debug("Received fulfillment"); fulfillmentTopic.ifPresent(topicName -> { try { GcpPacketResponseEvent gcpFulfillmentEvent = mapFulfillment(event); String payload = ma... |
@Test public void publishFulfillmentSkippedIfNotConfigured() { publisher = new DefaultGcpPacketResponseEventPublisher(template, Optional.empty(), Optional.of(REJECTS), OPERATOR_ADDRESS, mapper, clock); publisher.publish(mock(PacketFullfillmentEvent.class)); verifyNoInteractions(template); } | @Override public void publish(PacketFullfillmentEvent event) { logger.debug("Received fulfillment"); fulfillmentTopic.ifPresent(topicName -> { try { GcpPacketResponseEvent gcpFulfillmentEvent = mapFulfillment(event); String payload = mapper.writerFor(GcpPacketResponseEvent.class).writeValueAsString(gcpFulfillmentEvent)... | DefaultGcpPacketResponseEventPublisher implements GcpPacketResponseEventPublisher { @Override public void publish(PacketFullfillmentEvent event) { logger.debug("Received fulfillment"); fulfillmentTopic.ifPresent(topicName -> { try { GcpPacketResponseEvent gcpFulfillmentEvent = mapFulfillment(event); String payload = ma... | DefaultGcpPacketResponseEventPublisher implements GcpPacketResponseEventPublisher { @Override public void publish(PacketFullfillmentEvent event) { logger.debug("Received fulfillment"); fulfillmentTopic.ifPresent(topicName -> { try { GcpPacketResponseEvent gcpFulfillmentEvent = mapFulfillment(event); String payload = ma... | DefaultGcpPacketResponseEventPublisher implements GcpPacketResponseEventPublisher { @Override public void publish(PacketFullfillmentEvent event) { logger.debug("Received fulfillment"); fulfillmentTopic.ifPresent(topicName -> { try { GcpPacketResponseEvent gcpFulfillmentEvent = mapFulfillment(event); String payload = ma... | DefaultGcpPacketResponseEventPublisher implements GcpPacketResponseEventPublisher { @Override public void publish(PacketFullfillmentEvent event) { logger.debug("Received fulfillment"); fulfillmentTopic.ifPresent(topicName -> { try { GcpPacketResponseEvent gcpFulfillmentEvent = mapFulfillment(event); String payload = ma... |
@Test public void publishRejectionFromNextHop() { AccountSettings incomingAccount = AccountSettings.builder() .accountId(AccountId.of("hugh_honey")) .accountRelationship(AccountRelationship.PEER) .assetScale(9) .assetCode("XRP") .linkType(IlpOverHttpLink.LINK_TYPE) .build(); AccountSettings destinationAccount = Account... | @Override public void publish(PacketFullfillmentEvent event) { logger.debug("Received fulfillment"); fulfillmentTopic.ifPresent(topicName -> { try { GcpPacketResponseEvent gcpFulfillmentEvent = mapFulfillment(event); String payload = mapper.writerFor(GcpPacketResponseEvent.class).writeValueAsString(gcpFulfillmentEvent)... | DefaultGcpPacketResponseEventPublisher implements GcpPacketResponseEventPublisher { @Override public void publish(PacketFullfillmentEvent event) { logger.debug("Received fulfillment"); fulfillmentTopic.ifPresent(topicName -> { try { GcpPacketResponseEvent gcpFulfillmentEvent = mapFulfillment(event); String payload = ma... | DefaultGcpPacketResponseEventPublisher implements GcpPacketResponseEventPublisher { @Override public void publish(PacketFullfillmentEvent event) { logger.debug("Received fulfillment"); fulfillmentTopic.ifPresent(topicName -> { try { GcpPacketResponseEvent gcpFulfillmentEvent = mapFulfillment(event); String payload = ma... | DefaultGcpPacketResponseEventPublisher implements GcpPacketResponseEventPublisher { @Override public void publish(PacketFullfillmentEvent event) { logger.debug("Received fulfillment"); fulfillmentTopic.ifPresent(topicName -> { try { GcpPacketResponseEvent gcpFulfillmentEvent = mapFulfillment(event); String payload = ma... | DefaultGcpPacketResponseEventPublisher implements GcpPacketResponseEventPublisher { @Override public void publish(PacketFullfillmentEvent event) { logger.debug("Received fulfillment"); fulfillmentTopic.ifPresent(topicName -> { try { GcpPacketResponseEvent gcpFulfillmentEvent = mapFulfillment(event); String payload = ma... |
@Test public void publishRejectionFromCurrentHop() { AccountSettings incomingAccount = AccountSettings.builder() .accountId(AccountId.of("hugh_honey")) .accountRelationship(AccountRelationship.PEER) .assetScale(9) .assetCode("XRP") .linkType(IlpOverHttpLink.LINK_TYPE) .build(); InterledgerRejectPacket rejectPacket = In... | @Override public void publish(PacketFullfillmentEvent event) { logger.debug("Received fulfillment"); fulfillmentTopic.ifPresent(topicName -> { try { GcpPacketResponseEvent gcpFulfillmentEvent = mapFulfillment(event); String payload = mapper.writerFor(GcpPacketResponseEvent.class).writeValueAsString(gcpFulfillmentEvent)... | DefaultGcpPacketResponseEventPublisher implements GcpPacketResponseEventPublisher { @Override public void publish(PacketFullfillmentEvent event) { logger.debug("Received fulfillment"); fulfillmentTopic.ifPresent(topicName -> { try { GcpPacketResponseEvent gcpFulfillmentEvent = mapFulfillment(event); String payload = ma... | DefaultGcpPacketResponseEventPublisher implements GcpPacketResponseEventPublisher { @Override public void publish(PacketFullfillmentEvent event) { logger.debug("Received fulfillment"); fulfillmentTopic.ifPresent(topicName -> { try { GcpPacketResponseEvent gcpFulfillmentEvent = mapFulfillment(event); String payload = ma... | DefaultGcpPacketResponseEventPublisher implements GcpPacketResponseEventPublisher { @Override public void publish(PacketFullfillmentEvent event) { logger.debug("Received fulfillment"); fulfillmentTopic.ifPresent(topicName -> { try { GcpPacketResponseEvent gcpFulfillmentEvent = mapFulfillment(event); String payload = ma... | DefaultGcpPacketResponseEventPublisher implements GcpPacketResponseEventPublisher { @Override public void publish(PacketFullfillmentEvent event) { logger.debug("Received fulfillment"); fulfillmentTopic.ifPresent(topicName -> { try { GcpPacketResponseEvent gcpFulfillmentEvent = mapFulfillment(event); String payload = ma... |
@Test public void publishRejectionSkippedIfNotConfigured() { publisher = new DefaultGcpPacketResponseEventPublisher(template, Optional.of(FULFILLS), Optional.empty(), OPERATOR_ADDRESS, mapper, clock); publisher.publish(mock(PacketRejectionEvent.class)); verifyNoInteractions(template); } | @Override public void publish(PacketFullfillmentEvent event) { logger.debug("Received fulfillment"); fulfillmentTopic.ifPresent(topicName -> { try { GcpPacketResponseEvent gcpFulfillmentEvent = mapFulfillment(event); String payload = mapper.writerFor(GcpPacketResponseEvent.class).writeValueAsString(gcpFulfillmentEvent)... | DefaultGcpPacketResponseEventPublisher implements GcpPacketResponseEventPublisher { @Override public void publish(PacketFullfillmentEvent event) { logger.debug("Received fulfillment"); fulfillmentTopic.ifPresent(topicName -> { try { GcpPacketResponseEvent gcpFulfillmentEvent = mapFulfillment(event); String payload = ma... | DefaultGcpPacketResponseEventPublisher implements GcpPacketResponseEventPublisher { @Override public void publish(PacketFullfillmentEvent event) { logger.debug("Received fulfillment"); fulfillmentTopic.ifPresent(topicName -> { try { GcpPacketResponseEvent gcpFulfillmentEvent = mapFulfillment(event); String payload = ma... | DefaultGcpPacketResponseEventPublisher implements GcpPacketResponseEventPublisher { @Override public void publish(PacketFullfillmentEvent event) { logger.debug("Received fulfillment"); fulfillmentTopic.ifPresent(topicName -> { try { GcpPacketResponseEvent gcpFulfillmentEvent = mapFulfillment(event); String payload = ma... | DefaultGcpPacketResponseEventPublisher implements GcpPacketResponseEventPublisher { @Override public void publish(PacketFullfillmentEvent event) { logger.debug("Received fulfillment"); fulfillmentTopic.ifPresent(topicName -> { try { GcpPacketResponseEvent gcpFulfillmentEvent = mapFulfillment(event); String payload = ma... |
@Test public void getAccountBalance() { AccountId accountId = AccountId.of("test"); AccountSettings settings = AccountSettings.builder() .accountId(accountId) .description("child") .accountRelationship(AccountRelationship.CHILD) .linkType(IlpOverHttpLink.LINK_TYPE) .assetScale(2) .assetCode("XRP") .build(); AccountBala... | public AccountBalanceResponse getAccountBalance(final AccountId accountId) { Objects.requireNonNull(accountId); return accountSettingsRepository.findByAccountIdWithConversion(accountId) .map(settings -> AccountBalanceResponse.builder() .accountBalance(balanceTracker.balance(accountId)) .assetCode(settings.assetCode()) ... | AccountBalanceService { public AccountBalanceResponse getAccountBalance(final AccountId accountId) { Objects.requireNonNull(accountId); return accountSettingsRepository.findByAccountIdWithConversion(accountId) .map(settings -> AccountBalanceResponse.builder() .accountBalance(balanceTracker.balance(accountId)) .assetCod... | AccountBalanceService { public AccountBalanceResponse getAccountBalance(final AccountId accountId) { Objects.requireNonNull(accountId); return accountSettingsRepository.findByAccountIdWithConversion(accountId) .map(settings -> AccountBalanceResponse.builder() .accountBalance(balanceTracker.balance(accountId)) .assetCod... | AccountBalanceService { public AccountBalanceResponse getAccountBalance(final AccountId accountId) { Objects.requireNonNull(accountId); return accountSettingsRepository.findByAccountIdWithConversion(accountId) .map(settings -> AccountBalanceResponse.builder() .accountBalance(balanceTracker.balance(accountId)) .assetCod... | AccountBalanceService { public AccountBalanceResponse getAccountBalance(final AccountId accountId) { Objects.requireNonNull(accountId); return accountSettingsRepository.findByAccountIdWithConversion(accountId) .map(settings -> AccountBalanceResponse.builder() .accountBalance(balanceTracker.balance(accountId)) .assetCod... |
@Test public void getAllApplicationContextsWithChangingValue() { AtomicBoolean active = new AtomicBoolean(false); HashSet<ApplicationContext> contexts = Sets.newHashSet(mockContext(() -> active.get()), mockContext(() -> false)); assertThat(ApplicationContextProvider.findActiveContexts(contexts)).hasSize(0); active.set(... | @VisibleForTesting static Set<ApplicationContext> findActiveContexts(Set<ApplicationContext> contexts) { return contexts.stream() .filter(ctx -> ctx instanceof ConfigurableApplicationContext) .map(ctx -> (ConfigurableApplicationContext) ctx) .filter(ctx -> ctx.isActive()) .collect(Collectors.toSet()); } | ApplicationContextProvider implements ApplicationContextAware { @VisibleForTesting static Set<ApplicationContext> findActiveContexts(Set<ApplicationContext> contexts) { return contexts.stream() .filter(ctx -> ctx instanceof ConfigurableApplicationContext) .map(ctx -> (ConfigurableApplicationContext) ctx) .filter(ctx ->... | ApplicationContextProvider implements ApplicationContextAware { @VisibleForTesting static Set<ApplicationContext> findActiveContexts(Set<ApplicationContext> contexts) { return contexts.stream() .filter(ctx -> ctx instanceof ConfigurableApplicationContext) .map(ctx -> (ConfigurableApplicationContext) ctx) .filter(ctx ->... | ApplicationContextProvider implements ApplicationContextAware { @VisibleForTesting static Set<ApplicationContext> findActiveContexts(Set<ApplicationContext> contexts) { return contexts.stream() .filter(ctx -> ctx instanceof ConfigurableApplicationContext) .map(ctx -> (ConfigurableApplicationContext) ctx) .filter(ctx ->... | ApplicationContextProvider implements ApplicationContextAware { @VisibleForTesting static Set<ApplicationContext> findActiveContexts(Set<ApplicationContext> contexts) { return contexts.stream() .filter(ctx -> ctx instanceof ConfigurableApplicationContext) .map(ctx -> (ConfigurableApplicationContext) ctx) .filter(ctx ->... |
@Test public void isEqualRunsInConstantTime() { int arraySize = 250000; byte [] lotsOfBytes = new byte[arraySize]; Arrays.fill(lotsOfBytes, (byte) 0); byte [] sameLotsOfBytes = new byte[arraySize]; Arrays.fill(sameLotsOfBytes, (byte) 0); byte [] lotsMoreDifferentBytes = new byte[arraySize]; Arrays.fill(lotsMoreDifferen... | public static boolean isEqualUsingConstantTime(byte[] val1, byte[] val2) { if (val1.length != val2.length) { return false; } int result = 0; for (int i = 0; i < val1.length; i++) { result |= val1[i] ^ val2[i]; } return result == 0; } | ByteArrayUtils { public static boolean isEqualUsingConstantTime(byte[] val1, byte[] val2) { if (val1.length != val2.length) { return false; } int result = 0; for (int i = 0; i < val1.length; i++) { result |= val1[i] ^ val2[i]; } return result == 0; } } | ByteArrayUtils { public static boolean isEqualUsingConstantTime(byte[] val1, byte[] val2) { if (val1.length != val2.length) { return false; } int result = 0; for (int i = 0; i < val1.length; i++) { result |= val1[i] ^ val2[i]; } return result == 0; } } | ByteArrayUtils { public static boolean isEqualUsingConstantTime(byte[] val1, byte[] val2) { if (val1.length != val2.length) { return false; } int result = 0; for (int i = 0; i < val1.length; i++) { result |= val1[i] ^ val2[i]; } return result == 0; } static boolean isEqualUsingConstantTime(byte[] val1, byte[] val2); s... | ByteArrayUtils { public static boolean isEqualUsingConstantTime(byte[] val1, byte[] val2) { if (val1.length != val2.length) { return false; } int result = 0; for (int i = 0; i < val1.length; i++) { result |= val1[i] ^ val2[i]; } return result == 0; } static boolean isEqualUsingConstantTime(byte[] val1, byte[] val2); s... |
@Test public void getAccountBalanceAccountNotFound() { AccountId accountId = AccountId.of("test"); when(mockSettingsRepo.findByAccountIdWithConversion(accountId)).thenReturn(Optional.empty()); expectedException.expect(AccountNotFoundProblem.class); service.getAccountBalance(accountId); } | public AccountBalanceResponse getAccountBalance(final AccountId accountId) { Objects.requireNonNull(accountId); return accountSettingsRepository.findByAccountIdWithConversion(accountId) .map(settings -> AccountBalanceResponse.builder() .accountBalance(balanceTracker.balance(accountId)) .assetCode(settings.assetCode()) ... | AccountBalanceService { public AccountBalanceResponse getAccountBalance(final AccountId accountId) { Objects.requireNonNull(accountId); return accountSettingsRepository.findByAccountIdWithConversion(accountId) .map(settings -> AccountBalanceResponse.builder() .accountBalance(balanceTracker.balance(accountId)) .assetCod... | AccountBalanceService { public AccountBalanceResponse getAccountBalance(final AccountId accountId) { Objects.requireNonNull(accountId); return accountSettingsRepository.findByAccountIdWithConversion(accountId) .map(settings -> AccountBalanceResponse.builder() .accountBalance(balanceTracker.balance(accountId)) .assetCod... | AccountBalanceService { public AccountBalanceResponse getAccountBalance(final AccountId accountId) { Objects.requireNonNull(accountId); return accountSettingsRepository.findByAccountIdWithConversion(accountId) .map(settings -> AccountBalanceResponse.builder() .accountBalance(balanceTracker.balance(accountId)) .assetCod... | AccountBalanceService { public AccountBalanceResponse getAccountBalance(final AccountId accountId) { Objects.requireNonNull(accountId); return accountSettingsRepository.findByAccountIdWithConversion(accountId) .map(settings -> AccountBalanceResponse.builder() .accountBalance(balanceTracker.balance(accountId)) .assetCod... |
@Test public void publishRejectionByNextHop() { publisher.publishRejectionByNextHop(sourceAccountSettings, nextHopAccountSettings, preparePacket, nextHopPacket, fxRate, rejectPacket); verify(eventBus).post(PacketRejectionEvent.builder() .accountSettings(sourceAccountSettings) .destinationAccount(nextHopAccountSettings)... | @Override public void publishRejectionByNextHop(AccountSettings sourceAccountSettings, AccountSettings nextHopAccountSettings, InterledgerPreparePacket preparePacket, InterledgerPreparePacket nextHopPacket, BigDecimal fxRate, InterledgerRejectPacket rejectPacket) { eventBus.post(PacketRejectionEvent.builder() .accountS... | DefaultPacketEventPublisher implements PacketEventPublisher { @Override public void publishRejectionByNextHop(AccountSettings sourceAccountSettings, AccountSettings nextHopAccountSettings, InterledgerPreparePacket preparePacket, InterledgerPreparePacket nextHopPacket, BigDecimal fxRate, InterledgerRejectPacket rejectPa... | DefaultPacketEventPublisher implements PacketEventPublisher { @Override public void publishRejectionByNextHop(AccountSettings sourceAccountSettings, AccountSettings nextHopAccountSettings, InterledgerPreparePacket preparePacket, InterledgerPreparePacket nextHopPacket, BigDecimal fxRate, InterledgerRejectPacket rejectPa... | DefaultPacketEventPublisher implements PacketEventPublisher { @Override public void publishRejectionByNextHop(AccountSettings sourceAccountSettings, AccountSettings nextHopAccountSettings, InterledgerPreparePacket preparePacket, InterledgerPreparePacket nextHopPacket, BigDecimal fxRate, InterledgerRejectPacket rejectPa... | DefaultPacketEventPublisher implements PacketEventPublisher { @Override public void publishRejectionByNextHop(AccountSettings sourceAccountSettings, AccountSettings nextHopAccountSettings, InterledgerPreparePacket preparePacket, InterledgerPreparePacket nextHopPacket, BigDecimal fxRate, InterledgerRejectPacket rejectPa... |
@Test public void publishRejectionByConnector() { publisher.publishRejectionByConnector(sourceAccountSettings, preparePacket, rejectPacket); verify(eventBus).post(PacketRejectionEvent.builder() .accountSettings(sourceAccountSettings) .incomingPreparePacket(preparePacket) .rejection(rejectPacket) .message(rejectPacket.g... | @Override public void publishRejectionByConnector(AccountSettings sourceAccountSettings, InterledgerPreparePacket preparePacket, InterledgerRejectPacket rejectPacket) { eventBus.post(PacketRejectionEvent.builder() .accountSettings(sourceAccountSettings) .incomingPreparePacket(preparePacket) .message(rejectPacket.getMes... | DefaultPacketEventPublisher implements PacketEventPublisher { @Override public void publishRejectionByConnector(AccountSettings sourceAccountSettings, InterledgerPreparePacket preparePacket, InterledgerRejectPacket rejectPacket) { eventBus.post(PacketRejectionEvent.builder() .accountSettings(sourceAccountSettings) .inc... | DefaultPacketEventPublisher implements PacketEventPublisher { @Override public void publishRejectionByConnector(AccountSettings sourceAccountSettings, InterledgerPreparePacket preparePacket, InterledgerRejectPacket rejectPacket) { eventBus.post(PacketRejectionEvent.builder() .accountSettings(sourceAccountSettings) .inc... | DefaultPacketEventPublisher implements PacketEventPublisher { @Override public void publishRejectionByConnector(AccountSettings sourceAccountSettings, InterledgerPreparePacket preparePacket, InterledgerRejectPacket rejectPacket) { eventBus.post(PacketRejectionEvent.builder() .accountSettings(sourceAccountSettings) .inc... | DefaultPacketEventPublisher implements PacketEventPublisher { @Override public void publishRejectionByConnector(AccountSettings sourceAccountSettings, InterledgerPreparePacket preparePacket, InterledgerRejectPacket rejectPacket) { eventBus.post(PacketRejectionEvent.builder() .accountSettings(sourceAccountSettings) .inc... |
@Test public void publishFulfillment() { publisher.publishFulfillment(sourceAccountSettings, nextHopAccountSettings, preparePacket, nextHopPacket, fxRate, fulfillment); verify(eventBus).post(PacketFullfillmentEvent.builder() .accountSettings(sourceAccountSettings) .destinationAccount(nextHopAccountSettings) .outgoingPr... | @Override public void publishFulfillment(AccountSettings sourceAccountSettings, AccountSettings nextHopAccountSettings, InterledgerPreparePacket preparePacket, InterledgerPreparePacket nextHopPacket, BigDecimal fxRate, InterledgerFulfillment fulfillment) { eventBus.post(PacketFullfillmentEvent.builder() .accountSetting... | DefaultPacketEventPublisher implements PacketEventPublisher { @Override public void publishFulfillment(AccountSettings sourceAccountSettings, AccountSettings nextHopAccountSettings, InterledgerPreparePacket preparePacket, InterledgerPreparePacket nextHopPacket, BigDecimal fxRate, InterledgerFulfillment fulfillment) { e... | DefaultPacketEventPublisher implements PacketEventPublisher { @Override public void publishFulfillment(AccountSettings sourceAccountSettings, AccountSettings nextHopAccountSettings, InterledgerPreparePacket preparePacket, InterledgerPreparePacket nextHopPacket, BigDecimal fxRate, InterledgerFulfillment fulfillment) { e... | DefaultPacketEventPublisher implements PacketEventPublisher { @Override public void publishFulfillment(AccountSettings sourceAccountSettings, AccountSettings nextHopAccountSettings, InterledgerPreparePacket preparePacket, InterledgerPreparePacket nextHopPacket, BigDecimal fxRate, InterledgerFulfillment fulfillment) { e... | DefaultPacketEventPublisher implements PacketEventPublisher { @Override public void publishFulfillment(AccountSettings sourceAccountSettings, AccountSettings nextHopAccountSettings, InterledgerPreparePacket preparePacket, InterledgerPreparePacket nextHopPacket, BigDecimal fxRate, InterledgerFulfillment fulfillment) { e... |
@Test public void switchPacketWithNoAccount() { final AccountId NON_EXISTENT_ACCOUNT_ID = AccountId.of("123"); final LinkId NON_EXISTENT_LINK_ID = LinkId.of(NON_EXISTENT_ACCOUNT_ID.value()); when(accountSettingsLoadingCacheMock.getAccount(any())).thenReturn(Optional.empty()); final InterledgerRejectPacket rejectPacket ... | public final InterledgerResponsePacket switchPacket( final AccountId sourceAccountId, final InterledgerPreparePacket incomingSourcePreparePacket ) { Objects.requireNonNull(sourceAccountId); Objects.requireNonNull(incomingSourcePreparePacket); return this.accountSettingsLoadingCache.getAccount(sourceAccountId) .map(acco... | DefaultILPv4PacketSwitch implements ILPv4PacketSwitch { public final InterledgerResponsePacket switchPacket( final AccountId sourceAccountId, final InterledgerPreparePacket incomingSourcePreparePacket ) { Objects.requireNonNull(sourceAccountId); Objects.requireNonNull(incomingSourcePreparePacket); return this.accountSe... | DefaultILPv4PacketSwitch implements ILPv4PacketSwitch { public final InterledgerResponsePacket switchPacket( final AccountId sourceAccountId, final InterledgerPreparePacket incomingSourcePreparePacket ) { Objects.requireNonNull(sourceAccountId); Objects.requireNonNull(incomingSourcePreparePacket); return this.accountSe... | DefaultILPv4PacketSwitch implements ILPv4PacketSwitch { public final InterledgerResponsePacket switchPacket( final AccountId sourceAccountId, final InterledgerPreparePacket incomingSourcePreparePacket ) { Objects.requireNonNull(sourceAccountId); Objects.requireNonNull(incomingSourcePreparePacket); return this.accountSe... | DefaultILPv4PacketSwitch implements ILPv4PacketSwitch { public final InterledgerResponsePacket switchPacket( final AccountId sourceAccountId, final InterledgerPreparePacket incomingSourcePreparePacket ) { Objects.requireNonNull(sourceAccountId); Objects.requireNonNull(incomingSourcePreparePacket); return this.accountSe... |
@Test public void switchPacketMultipleTimeWithSameAccount() { final ImmutableAccountSettings incomingAccountSettings = AccountSettings.builder() .accountId(INCOMING_ACCOUNT_ID) .accountRelationship(AccountRelationship.PEER) .assetCode("USD") .assetScale(2) .linkType(LoopbackLink.LINK_TYPE) .build(); when(accountSetting... | public final InterledgerResponsePacket switchPacket( final AccountId sourceAccountId, final InterledgerPreparePacket incomingSourcePreparePacket ) { Objects.requireNonNull(sourceAccountId); Objects.requireNonNull(incomingSourcePreparePacket); return this.accountSettingsLoadingCache.getAccount(sourceAccountId) .map(acco... | DefaultILPv4PacketSwitch implements ILPv4PacketSwitch { public final InterledgerResponsePacket switchPacket( final AccountId sourceAccountId, final InterledgerPreparePacket incomingSourcePreparePacket ) { Objects.requireNonNull(sourceAccountId); Objects.requireNonNull(incomingSourcePreparePacket); return this.accountSe... | DefaultILPv4PacketSwitch implements ILPv4PacketSwitch { public final InterledgerResponsePacket switchPacket( final AccountId sourceAccountId, final InterledgerPreparePacket incomingSourcePreparePacket ) { Objects.requireNonNull(sourceAccountId); Objects.requireNonNull(incomingSourcePreparePacket); return this.accountSe... | DefaultILPv4PacketSwitch implements ILPv4PacketSwitch { public final InterledgerResponsePacket switchPacket( final AccountId sourceAccountId, final InterledgerPreparePacket incomingSourcePreparePacket ) { Objects.requireNonNull(sourceAccountId); Objects.requireNonNull(incomingSourcePreparePacket); return this.accountSe... | DefaultILPv4PacketSwitch implements ILPv4PacketSwitch { public final InterledgerResponsePacket switchPacket( final AccountId sourceAccountId, final InterledgerPreparePacket incomingSourcePreparePacket ) { Objects.requireNonNull(sourceAccountId); Objects.requireNonNull(incomingSourcePreparePacket); return this.accountSe... |
@Test public void switchPacketMultipleTimeWithDifferentAccounts() { final int numReps = 5; for (int i = 0; i < numReps; i++) { final AccountId incomingAccountID = AccountId.of(INCOMING_ACCOUNT_ID.value() + i); final AccountId outgoingAccountID = AccountId.of(OUTGOING_ACCOUNT_ID.value() + i); final AccountSettings incom... | public final InterledgerResponsePacket switchPacket( final AccountId sourceAccountId, final InterledgerPreparePacket incomingSourcePreparePacket ) { Objects.requireNonNull(sourceAccountId); Objects.requireNonNull(incomingSourcePreparePacket); return this.accountSettingsLoadingCache.getAccount(sourceAccountId) .map(acco... | DefaultILPv4PacketSwitch implements ILPv4PacketSwitch { public final InterledgerResponsePacket switchPacket( final AccountId sourceAccountId, final InterledgerPreparePacket incomingSourcePreparePacket ) { Objects.requireNonNull(sourceAccountId); Objects.requireNonNull(incomingSourcePreparePacket); return this.accountSe... | DefaultILPv4PacketSwitch implements ILPv4PacketSwitch { public final InterledgerResponsePacket switchPacket( final AccountId sourceAccountId, final InterledgerPreparePacket incomingSourcePreparePacket ) { Objects.requireNonNull(sourceAccountId); Objects.requireNonNull(incomingSourcePreparePacket); return this.accountSe... | DefaultILPv4PacketSwitch implements ILPv4PacketSwitch { public final InterledgerResponsePacket switchPacket( final AccountId sourceAccountId, final InterledgerPreparePacket incomingSourcePreparePacket ) { Objects.requireNonNull(sourceAccountId); Objects.requireNonNull(incomingSourcePreparePacket); return this.accountSe... | DefaultILPv4PacketSwitch implements ILPv4PacketSwitch { public final InterledgerResponsePacket switchPacket( final AccountId sourceAccountId, final InterledgerPreparePacket incomingSourcePreparePacket ) { Objects.requireNonNull(sourceAccountId); Objects.requireNonNull(incomingSourcePreparePacket); return this.accountSe... |
@Test public void switchExpiredPacket() { final ImmutableAccountSettings incomingAccountSettings = AccountSettings.builder() .accountId(INCOMING_ACCOUNT_ID) .accountRelationship(AccountRelationship.PEER) .assetCode("USD") .assetScale(2) .linkType(LoopbackLink.LINK_TYPE) .build(); when(accountSettingsLoadingCacheMock.ge... | public final InterledgerResponsePacket switchPacket( final AccountId sourceAccountId, final InterledgerPreparePacket incomingSourcePreparePacket ) { Objects.requireNonNull(sourceAccountId); Objects.requireNonNull(incomingSourcePreparePacket); return this.accountSettingsLoadingCache.getAccount(sourceAccountId) .map(acco... | DefaultILPv4PacketSwitch implements ILPv4PacketSwitch { public final InterledgerResponsePacket switchPacket( final AccountId sourceAccountId, final InterledgerPreparePacket incomingSourcePreparePacket ) { Objects.requireNonNull(sourceAccountId); Objects.requireNonNull(incomingSourcePreparePacket); return this.accountSe... | DefaultILPv4PacketSwitch implements ILPv4PacketSwitch { public final InterledgerResponsePacket switchPacket( final AccountId sourceAccountId, final InterledgerPreparePacket incomingSourcePreparePacket ) { Objects.requireNonNull(sourceAccountId); Objects.requireNonNull(incomingSourcePreparePacket); return this.accountSe... | DefaultILPv4PacketSwitch implements ILPv4PacketSwitch { public final InterledgerResponsePacket switchPacket( final AccountId sourceAccountId, final InterledgerPreparePacket incomingSourcePreparePacket ) { Objects.requireNonNull(sourceAccountId); Objects.requireNonNull(incomingSourcePreparePacket); return this.accountSe... | DefaultILPv4PacketSwitch implements ILPv4PacketSwitch { public final InterledgerResponsePacket switchPacket( final AccountId sourceAccountId, final InterledgerPreparePacket incomingSourcePreparePacket ) { Objects.requireNonNull(sourceAccountId); Objects.requireNonNull(incomingSourcePreparePacket); return this.accountSe... |
@Test public void doFilterWithNoAccount() { when(cacheMock.get(any(), any())).thenReturn(Optional.empty()); filter.doFilter(accountSettingsMock, PREPARE_PACKET, filterChainMock); filter.doFilter(accountSettingsMock, PREPARE_PACKET, filterChainMock); filter.doFilter(accountSettingsMock, PREPARE_PACKET, filterChainMock);... | @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { return rateLimiters .get( sourceAccountSettings.accountId(), (key) -> sourceAccountSettings.rateLimitSettings().maxPacketsPe... | RateLimitIlpPacketFilter extends AbstractPacketFilter implements PacketSwitchFilter { @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { return rateLimiters .get( sourceAccoun... | RateLimitIlpPacketFilter extends AbstractPacketFilter implements PacketSwitchFilter { @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { return rateLimiters .get( sourceAccoun... | RateLimitIlpPacketFilter extends AbstractPacketFilter implements PacketSwitchFilter { @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { return rateLimiters .get( sourceAccoun... | RateLimitIlpPacketFilter extends AbstractPacketFilter implements PacketSwitchFilter { @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { return rateLimiters .get( sourceAccoun... |
@Test public void doFilterWithNoMaxPacketAmount() { when(cacheMock.get(any(), any())).thenReturn(Optional.of(rateLimiterMock)); when(rateLimiterMock.tryAcquire(1)).thenReturn(true); when(rateLimitSettingsMock.maxPacketsPerSecond()).thenReturn(Optional.empty()); InterledgerResponsePacket response = filter.doFilter(accou... | @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { return rateLimiters .get( sourceAccountSettings.accountId(), (key) -> sourceAccountSettings.rateLimitSettings().maxPacketsPe... | RateLimitIlpPacketFilter extends AbstractPacketFilter implements PacketSwitchFilter { @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { return rateLimiters .get( sourceAccoun... | RateLimitIlpPacketFilter extends AbstractPacketFilter implements PacketSwitchFilter { @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { return rateLimiters .get( sourceAccoun... | RateLimitIlpPacketFilter extends AbstractPacketFilter implements PacketSwitchFilter { @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { return rateLimiters .get( sourceAccoun... | RateLimitIlpPacketFilter extends AbstractPacketFilter implements PacketSwitchFilter { @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { return rateLimiters .get( sourceAccoun... |
@Test public void testExtendMessageConvertersWhenEmpty() { List<HttpMessageConverter<?>> messageConverters = Lists.newArrayList(); springConnectorWebMvc.extendMessageConverters(messageConverters); assertThat(messageConverters.size()).isEqualTo(0); } | @Override public void extendMessageConverters(List<HttpMessageConverter<?>> converters) { converters.replaceAll(messageConverter -> { if (messageConverter instanceof MappingJackson2HttpMessageConverter) { if (((MappingJackson2HttpMessageConverter) messageConverter).getObjectMapper().getRegisteredModuleIds() .contains(P... | SpringConnectorWebMvc implements WebMvcConfigurer { @Override public void extendMessageConverters(List<HttpMessageConverter<?>> converters) { converters.replaceAll(messageConverter -> { if (messageConverter instanceof MappingJackson2HttpMessageConverter) { if (((MappingJackson2HttpMessageConverter) messageConverter).ge... | SpringConnectorWebMvc implements WebMvcConfigurer { @Override public void extendMessageConverters(List<HttpMessageConverter<?>> converters) { converters.replaceAll(messageConverter -> { if (messageConverter instanceof MappingJackson2HttpMessageConverter) { if (((MappingJackson2HttpMessageConverter) messageConverter).ge... | SpringConnectorWebMvc implements WebMvcConfigurer { @Override public void extendMessageConverters(List<HttpMessageConverter<?>> converters) { converters.replaceAll(messageConverter -> { if (messageConverter instanceof MappingJackson2HttpMessageConverter) { if (((MappingJackson2HttpMessageConverter) messageConverter).ge... | SpringConnectorWebMvc implements WebMvcConfigurer { @Override public void extendMessageConverters(List<HttpMessageConverter<?>> converters) { converters.replaceAll(messageConverter -> { if (messageConverter instanceof MappingJackson2HttpMessageConverter) { if (((MappingJackson2HttpMessageConverter) messageConverter).ge... |
@Test public void doFilterWithInsufficientTickets() { when(cacheMock.get(any(), any())).thenReturn(Optional.of(rateLimiterMock)); when(rateLimiterMock.acquire()).thenReturn(0.0); when(rateLimitSettingsMock.maxPacketsPerSecond()).thenReturn(Optional.of(1)); InterledgerResponsePacket response = filter.doFilter(accountSet... | @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { return rateLimiters .get( sourceAccountSettings.accountId(), (key) -> sourceAccountSettings.rateLimitSettings().maxPacketsPe... | RateLimitIlpPacketFilter extends AbstractPacketFilter implements PacketSwitchFilter { @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { return rateLimiters .get( sourceAccoun... | RateLimitIlpPacketFilter extends AbstractPacketFilter implements PacketSwitchFilter { @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { return rateLimiters .get( sourceAccoun... | RateLimitIlpPacketFilter extends AbstractPacketFilter implements PacketSwitchFilter { @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { return rateLimiters .get( sourceAccoun... | RateLimitIlpPacketFilter extends AbstractPacketFilter implements PacketSwitchFilter { @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { return rateLimiters .get( sourceAccoun... |
@Test public void doFilterWithNoPermits() { when(cacheMock.get(any(), any())).thenReturn(Optional.of(rateLimiterMock)); when(rateLimiterMock.tryAcquire(1)).thenReturn(Boolean.FALSE); InterledgerResponsePacket response = filter.doFilter(accountSettingsMock, PREPARE_PACKET, filterChainMock); assertThat(response instanceo... | @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { return rateLimiters .get( sourceAccountSettings.accountId(), (key) -> sourceAccountSettings.rateLimitSettings().maxPacketsPe... | RateLimitIlpPacketFilter extends AbstractPacketFilter implements PacketSwitchFilter { @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { return rateLimiters .get( sourceAccoun... | RateLimitIlpPacketFilter extends AbstractPacketFilter implements PacketSwitchFilter { @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { return rateLimiters .get( sourceAccoun... | RateLimitIlpPacketFilter extends AbstractPacketFilter implements PacketSwitchFilter { @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { return rateLimiters .get( sourceAccoun... | RateLimitIlpPacketFilter extends AbstractPacketFilter implements PacketSwitchFilter { @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { return rateLimiters .get( sourceAccoun... |
@Test public void doFilterWithPermit() { when(cacheMock.get(any(), any())).thenReturn(Optional.of(rateLimiterMock)); when(rateLimiterMock.tryAcquire(1)).thenReturn(true); InterledgerResponsePacket response = filter.doFilter(accountSettingsMock, PREPARE_PACKET, filterChainMock); assertThat(response instanceof Interledge... | @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { return rateLimiters .get( sourceAccountSettings.accountId(), (key) -> sourceAccountSettings.rateLimitSettings().maxPacketsPe... | RateLimitIlpPacketFilter extends AbstractPacketFilter implements PacketSwitchFilter { @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { return rateLimiters .get( sourceAccoun... | RateLimitIlpPacketFilter extends AbstractPacketFilter implements PacketSwitchFilter { @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { return rateLimiters .get( sourceAccoun... | RateLimitIlpPacketFilter extends AbstractPacketFilter implements PacketSwitchFilter { @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { return rateLimiters .get( sourceAccoun... | RateLimitIlpPacketFilter extends AbstractPacketFilter implements PacketSwitchFilter { @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { return rateLimiters .get( sourceAccoun... |
@Test public void doFilterWithNoRateLimiter() { when(cacheMock.get(any(), any())).thenReturn(Optional.empty()); InterledgerResponsePacket response = filter.doFilter(accountSettingsMock, PREPARE_PACKET, filterChainMock); assertThat(response instanceof InterledgerFulfillPacket).isTrue(); response = filter.doFilter(accoun... | @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { return rateLimiters .get( sourceAccountSettings.accountId(), (key) -> sourceAccountSettings.rateLimitSettings().maxPacketsPe... | RateLimitIlpPacketFilter extends AbstractPacketFilter implements PacketSwitchFilter { @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { return rateLimiters .get( sourceAccoun... | RateLimitIlpPacketFilter extends AbstractPacketFilter implements PacketSwitchFilter { @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { return rateLimiters .get( sourceAccoun... | RateLimitIlpPacketFilter extends AbstractPacketFilter implements PacketSwitchFilter { @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { return rateLimiters .get( sourceAccoun... | RateLimitIlpPacketFilter extends AbstractPacketFilter implements PacketSwitchFilter { @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { return rateLimiters .get( sourceAccoun... |
@Test public void doFilterForPeerDotConfigWhenDisabled() { when(enabledProtocolSettingsMock.isIldcpEnabled()).thenReturn(false); final InterledgerPreparePacket preparePacket = this.constructPreparePacket(IldcpRequestPacket.PEER_DOT_CONFIG); filter.doFilter(accountSettingsMock, preparePacket, filterChainMock).handle( fu... | @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { if (sourcePreparePacket.getDestination().startsWith(InterledgerAddress.AllocationScheme.PEER.getValue())) { if (sourcePrepar... | PeerProtocolPacketFilter extends AbstractPacketFilter implements PacketSwitchFilter { @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { if (sourcePreparePacket.getDestination... | PeerProtocolPacketFilter extends AbstractPacketFilter implements PacketSwitchFilter { @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { if (sourcePreparePacket.getDestination... | PeerProtocolPacketFilter extends AbstractPacketFilter implements PacketSwitchFilter { @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { if (sourcePreparePacket.getDestination... | PeerProtocolPacketFilter extends AbstractPacketFilter implements PacketSwitchFilter { @Override public InterledgerResponsePacket doFilter( final AccountSettings sourceAccountSettings, final InterledgerPreparePacket sourcePreparePacket, final PacketSwitchFilterChain filterChain ) { if (sourcePreparePacket.getDestination... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.