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

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

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

origin: commercetools/commercetools-jvm-sdk

  @Test
  public void taxCategory() throws Exception {
    TaxCategoryFixtures.withTransientTaxCategory(client(), taxCategory ->
      withProduct(client(), product -> {
        final Product productWithTaxCategory = client().executeBlocking(ProductUpdateCommand.of(product, SetTaxCategory.of(taxCategory)));
        assertThat(productWithTaxCategory.getTaxCategory()).isNotNull();
        final Query<Product> query = ProductQuery.of().
            bySlug(ProductProjectionType.CURRENT, Locale.ENGLISH, englishSlugOf(product.getMasterData().getStaged())).
            withExpansionPaths(ProductExpansionModel.of().taxCategory()).
            toQuery();
        final PagedQueryResult<Product> queryResult = client().executeBlocking(query);
        final Reference<TaxCategory> productTypeReference = firstOf(queryResult).getTaxCategory();
        assertThat(productTypeReference).is(expanded());
      })
    );
  }
}
io.sphere.sdk.testSphereTestUtilsfirstOf

Popular methods of SphereTestUtils

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

Popular in Java

  • Making http requests using okhttp
  • runOnUiThread (Activity)
  • compareTo (BigDecimal)
  • startActivity (Activity)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Notification (javax.management)
  • Top Vim 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