@Test public void testDeleteProductsByYandexId() { // Given assertThat(productDao.findByYandexId("10495462").size()).isEqualTo(2); // When productDao.deleteProductsByYandexId("10495462"); // Then assertThat(productDao.findByYandexId("10495462").size()).isEqualTo(0); }
@Test public void testFindByYandexId() { // When List<Product> products = productDao.findByYandexId("10495459"); // Then Product expectedProduct = new Product(); expectedProduct.setId(200L); Product expectedProduct1 = new Product(); expectedProduct1.setId(201L); assertThat(products).isEqualTo(Arrays.asList(expectedProduct, expectedProduct1)); }