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

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

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

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

public static final ZonedDateTime tomorrowZonedDateTime() {
  return now().plus(1, ChronoUnit.DAYS);
}
origin: commercetools/commercetools-jvm-sdk

public static ZonedDateTime tomorrowZonedDateTime() {
  return now().plus(1, ChronoUnit.DAYS);
}
origin: commercetools/commercetools-jvm-sdk

  private ZonedDateTime dateTimeAfterValidFromAndOldValidUntil(final CartDiscount cartDiscount) {
    return Optional.ofNullable(cartDiscount.getValidUntil())
        .orElse(Optional.ofNullable(cartDiscount.getValidFrom()).orElse(SphereTestUtils.now()).plusSeconds(1000)).plusSeconds(1);
  }
}
origin: commercetools/commercetools-jvm-sdk

@Test
public void addPriceWithValidityPeriod() throws Exception {
  final PriceDraft expectedPrice = PriceDraft.of(MoneyImpl.of(123, EUR))
      .withValidFrom(SphereTestUtils.now())
      .withValidUntil(SphereTestUtils.now().withZoneSameLocal(ZoneOffset.UTC).plusHours(2));
  testAddPrice(expectedPrice);
}
origin: commercetools/commercetools-jvm-sdk

@Test
public void getCompletedAt() throws Exception {
  final ZonedDateTime completedAt = SphereTestUtils.now().minusSeconds(5555);
  testOrderAspect(builder -> builder.completedAt(completedAt),
      order -> assertThat(order.getCompletedAt()).isEqualTo(completedAt));
}
origin: commercetools/commercetools-jvm-sdk

@Test
public void execution() throws Exception {
  final ZonedDateTime validFrom = SphereTestUtils.now();
  final ZonedDateTime validUntil = validFrom.plusSeconds(8000);
  final LocalizedString name = en("discount name");
origin: commercetools/commercetools-jvm-sdk

  @Test
  public void setExpectedDelivery() throws Exception {
    withUpdateableInventoryEntry(client(), entry -> {
      final ZonedDateTime expectedDelivery = SphereTestUtils.now().plus(7, ChronoUnit.DAYS);
      final UpdateAction<InventoryEntry> action = SetExpectedDelivery.of(expectedDelivery);
      final InventoryEntry updatedEntry = client().executeBlocking(InventoryEntryUpdateCommand.of(entry, action));
      assertThat(updatedEntry.getExpectedDelivery())
          .isEqualTo(expectedDelivery);
      return updatedEntry;
    });
  }
}
origin: commercetools/commercetools-jvm-sdk

@Test
public void setValidFrom() throws Exception {
  withPersistentCartDiscount(client(), cartDiscount -> {
    final ZonedDateTime dateTime = SphereTestUtils.now();
    assertThat(cartDiscount.getValidFrom()).isNotEqualTo(dateTime);
    final List<UpdateAction<CartDiscount>> updateActions =
        asList(SetValidUntil.of(dateTime.plus(7, ChronoUnit.DAYS)), SetValidFrom.of(dateTime));
    final CartDiscount updatedDiscount = client().executeBlocking(CartDiscountUpdateCommand.of(cartDiscount, updateActions));
    assertThat(updatedDiscount.getValidFrom()).isEqualTo(dateTime);
  });
}
origin: commercetools/commercetools-jvm-sdk

@Test
public void dateTimeAttribute() throws Exception {
  final ZonedDateTime now = SphereTestUtils.now().withZoneSameInstant(ZoneOffset.UTC);
  testSingleAndSet(AttributeAccess.ofDateTime(), AttributeAccess.ofDateTimeSet(),
      asSet(now, now.plus(3, ChronoUnit.DAYS)),
      DateTimeAttributeType.of(),
      AttributeDefinitionBuilder.of("datetime-attribute", LABEL, DateTimeAttributeType.of()).build());
}
origin: commercetools/commercetools-jvm-sdk

final Reference<TaxCategory> taxCategoryRef = taxCategory.toReference();
final Reference<ShippingMethod> shippingMethodRef = shippingMethod.toReference();
final ZonedDateTime createdAt = SphereTestUtils.now().minusSeconds(4);
final ParcelMeasurements parcelMeasurements = ParcelMeasurements.of(2, 3, 1, 3);
final LineItemLike lineItem = new LineItemLike() {
io.sphere.sdk.testSphereTestUtilsnow

Popular methods of SphereTestUtils

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

Popular in Java

  • Making http post requests using okhttp
  • scheduleAtFixedRate (Timer)
  • addToBackStack (FragmentTransaction)
  • getSystemService (Context)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Option (scala)
  • Top Sublime Text plugins
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