default ProductProjectionQuery bySlug(final Locale locale, final String slug) { return withPredicates(m -> m.slug().lang(locale).is(slug)); }
default ProductProjectionQuery bySlug(final Locale locale, final String slug) { return withPredicates(m -> m.slug().lang(locale).is(slug)); }
default ProductProjectionQuery bySlug(final Locale locale, final String slug) { return withPredicates(m -> m.slug().lang(locale).is(slug)); }
public Query<ProductProjection> bySlug(final Locale locale, final String slug) { return withPredicate(model().slug().lang(locale).is(slug)); }
public Query<ProductProjection> bySlug(final Locale locale, final String slug) { return withPredicate(model().slug().lang(locale).is(slug)); }
@Test public void execution2() throws Exception { withProduct(client(), product -> { final String slug = product.getMasterData().getStaged().getSlug().get(Locale.ENGLISH); final ProductProjectionQuery normalSphereRequest = ProductProjectionQuery.ofStaged() .withPredicates(m -> m.slug().locale(Locale.ENGLISH).is(slug)) .plusExpansionPaths(m -> m.productType()); final JsonNodeSphereRequest jsonNodeSphereRequest = JsonNodeSphereRequest.of(normalSphereRequest); assertThat(normalSphereRequest.httpRequestIntent()) .as("a JsonNodeSphereRequest creates the same request to the platform, but differs in the response") .isEqualTo(jsonNodeSphereRequest.httpRequestIntent()); final PagedQueryResult<ProductProjection> productProjectionPagedSearchResult = client().executeBlocking(normalSphereRequest); final JsonNode jsonNode = client().executeBlocking(jsonNodeSphereRequest);//all will be returned as JSON assertThat(jsonNode.get("results").get(0).get("productType").get("obj").get("description").asText()) .as("the expansion paths are honored") .isEqualTo("a 'T' shaped cloth"); }); } }