Tabnine Logo
SphereTestUtils.randomInt
Code IndexAdd Tabnine to your IDE (free)

How to use
randomInt
method
in
io.sphere.sdk.test.SphereTestUtils

Best Java code snippets using io.sphere.sdk.test.SphereTestUtils.randomInt (Showing top 10 results out of 315)

origin: io.sphere.sdk.jvm/sphere-test-lib

public static String randomSortOrder() {
  final int append = 5;//hack to not have a trailing 0 which is not accepted in sphere
  return  "0." + randomInt() + append;
}
origin: commercetools/commercetools-jvm-sdk

public static String randomSortOrder() {
  final int append = 5;//hack to not have a trailing 0 which is not accepted in sphere
  return  "0." + randomInt() + append;
}
origin: commercetools/commercetools-jvm-sdk

public static SubscriptionDraftBuilder ironMqSubscriptionDraftBuilder() {
  final String ironMqUriFromEnv = ironMqUriFromEnv();
  final String ironMqKey = "iron-mq-test-subscription-" + randomInt();
  final URI ironMqUri = URI.create(ironMqUriFromEnv);
  return SubscriptionDraftBuilder.of(IronMqDestination.of(ironMqUri))
      .key(ironMqKey);
}
origin: commercetools/commercetools-jvm-sdk

public static SubscriptionDraftBuilder sqsSubscriptionDraftBuilder(final String queueUrl) {
  final AwsCredentials awsCredentials = AwsCredentials.ofAwsCliEnv();
  final String awsRegion = System.getenv(AWS_REGION);
  assumeNotNull(awsRegion);
  final String sqsKey = "sqs-test-subscription-" + randomInt();
  return SubscriptionDraftBuilder.of(SqsDestination.of(awsCredentials, awsRegion, URI.create(queueUrl)))
      .key(sqsKey);
}
origin: commercetools/commercetools-jvm-sdk

@Test
public void invalidCurrentPassword() throws Exception {
  withCustomer(client(), customer -> {
    final String oldPassword = PASSWORD + randomInt();
    final String newPassword = "newSecret";
    final Throwable throwable = catchThrowable(() -> client().executeBlocking(CustomerChangePasswordCommand.of(customer, oldPassword, newPassword)));
    assertThat(throwable).isInstanceOf(ErrorResponseException.class);
    final ErrorResponseException errorResponseException = (ErrorResponseException) throwable;
    assertThat(errorResponseException.hasErrorCode(CustomerInvalidCurrentPassword.CODE)).isTrue();
  });
}
origin: commercetools/commercetools-jvm-sdk

private static void withFilledImportedOrderDraftBuilder(final BlockingSphereClient client, final Consumer<OrderImportDraftBuilder> operator) {
  withTransientTaxCategory(client, taxCategory -> {
    final MonetaryAmount lineItemPrice = MoneyImpl.ofCents(randomInt(), EUR);
    final CustomLineItemImportDraft customLineItemImportDraft = CustomLineItemImportDraftBuilder.of(randomSlug(), 1, lineItemPrice, taxCategory).build();
    final OrderImportDraftBuilder builder = OrderImportDraftBuilder.ofCustomLineItems(lineItemPrice, OrderState.OPEN, singletonList(customLineItemImportDraft));
    operator.accept(builder);
  });
}
origin: commercetools/commercetools-jvm-sdk

@Test
public void changeCartPredicate() throws Exception {
  withPersistentCartDiscount(client(), cartDiscount -> {
    final String newPredicate = format("totalPrice > \"%d.00 EUR\"", randomInt());
    assertThat(cartDiscount.getCartPredicate()).isNotEqualTo(newPredicate);
    final CartDiscount updatedDiscount =
        client().executeBlocking(CartDiscountUpdateCommand.of(cartDiscount, ChangeCartPredicate.of(newPredicate)));
    assertThat(updatedDiscount.getCartPredicate()).isEqualTo(newPredicate);
  });
}
origin: commercetools/commercetools-jvm-sdk

public static SubscriptionDraftBuilder azureServiceBusSubscriptionDraftBuilder() {
  final String connectionString = azureSBConnectionStringFromEnv();
  final String subscriptionQueue = "azure-sb-test-subscription-" + randomInt();
  return SubscriptionDraftBuilder.of(AzureServiceBusDestination.of(connectionString)).key(subscriptionQueue);
}
/**
origin: commercetools/commercetools-jvm-sdk

public static SubscriptionDraftBuilder snsSubscriptionDraftBuilder(final String topicArn) {
  final AwsCredentials awsCredentials = AwsCredentials.ofAwsCliEnv();
  final String snsKey = "sns-test-subscription-" + randomInt();
  return SubscriptionDraftBuilder.of(SnsDestination.of(awsCredentials, topicArn))
      .key(snsKey);
}
origin: commercetools/commercetools-jvm-sdk

@Test
public void changeValue() throws Exception {
  withPersistentCartDiscount(client(), cartDiscount -> {
    final CartDiscountValue newValue = CartDiscountValue.ofAbsolute(MoneyImpl.of(randomInt(), EUR));
    assertThat(cartDiscount.getValue()).isNotEqualTo(newValue);
    final CartDiscount updatedDiscount =
        client().executeBlocking(CartDiscountUpdateCommand.of(cartDiscount, ChangeValue.of(newValue)));
    assertThat(updatedDiscount.getValue()).isEqualTo(newValue);
  });
}
io.sphere.sdk.testSphereTestUtilsrandomInt

Popular methods of SphereTestUtils

  • randomKey
  • randomString
  • assertEventually
  • now
  • en
  • jsonNodeFromResource
  • stringFromResource
  • asList
  • consumerToFunction
  • draftFromJsonResource
  • englishSlugOf
  • firstOf
  • englishSlugOf,
  • firstOf,
  • oneOf,
  • randomEmail,
  • randomLocalizedString,
  • randomLong,
  • randomMetaAttributes,
  • randomSlug,
  • randomSortOrder

Popular in Java

  • Finding current android device location
  • getApplicationContext (Context)
  • getSupportFragmentManager (FragmentActivity)
  • getSystemService (Context)
  • Menu (java.awt)
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • JFileChooser (javax.swing)
  • JFrame (javax.swing)
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now