### Question:
GraphqlDataServiceImpl implements GraphqlDataService { @Override public List<ProductInterface> searchProducts(String text, Integer categoryId, Integer currentPage, Integer pageSize, String storeView) { return searchProductsImpl(text, categoryId, currentPage, pageSize, storeView); }  @Activate void activate(GraphqlDataServiceConfiguration conf); @Override ProductInterface getProductBySku(String sku, String storeView); @Override CategoryTree getCategoryById(Integer id, String storeView); @Override CategoryTree getCategoryByPath(String urlPath, String storeView); @Override List<ProductInterface> searchProducts(String text, Integer categoryId, Integer currentPage, Integer pageSize, String storeView); @Override List<CategoryTree> searchCategories(String text, Integer categoryId, Integer currentPage, Integer pageSize, String storeView); @Override CategoryProducts getCategoryProducts(Integer categoryId, Integer currentPage, Integer pageSize, String storeView); @Override String getIdentifier();  }### Answer:
@Test public void testSearchProducts() throws Exception { String query = getResource("graphql-queries/products-search.txt"); Utils.setupHttpResponse("magento-graphql-products-search.json", httpClient, HttpStatus.SC_OK, query); List<ProductInterface> products = dataService.searchProducts("coats", null, 0, 3, null); assertEquals(3, products.size()); }
@Test public void testSearchProductsForCategory() throws Exception { String query = getResource("graphql-queries/products-search-for-category.txt"); Utils.setupHttpResponse("magento-graphql-products-search.json", httpClient, HttpStatus.SC_OK, query); List<ProductInterface> products = dataService.searchProducts("coats", 11, 0, 3, null); assertEquals(3, products.size()); }
@Test public void testEmptySearchProducts() throws Exception { String query = getResource("graphql-queries/products-empty-search.txt"); Utils.setupHttpResponse("magento-graphql-products-search.json", httpClient, HttpStatus.SC_OK, query); List<ProductInterface> products = dataService.searchProducts(null, null, 0, 3, null); assertEquals(3, products.size()); }
@Test public void testEmptySearchProductsForCategory() throws Exception { String query = getResource("graphql-queries/products-empty-search-for-category.txt"); Utils.setupHttpResponse("magento-graphql-products-search.json", httpClient, HttpStatus.SC_OK, query); List<ProductInterface> products = dataService.searchProducts(null, 11, 0, 3, null); assertEquals(3, products.size()); }