Skip to content

Instantly share code, notes, and snippets.

@tbelmega
Created April 27, 2019 09:19
Show Gist options
  • Save tbelmega/e3a957417dd33656b113590de14b3038 to your computer and use it in GitHub Desktop.
Save tbelmega/e3a957417dd33656b113590de14b3038 to your computer and use it in GitHub Desktop.
@Test
fun `findMostOrderedProducts - 6 orders for 3 products in db - returns Top 2`() {
// given
val numberOfProducts = 2
val product1 = Product("1", "Ryzen 7 2700X", "AMD")
val product2 = Product("2", "Core i9 9900K", "Intel")
// when
val foundProducts = productRepository.findMostOrderedProducts(numberOfProducts)
// then
assertThat(foundProducts).hasSize(numberOfProducts)
assertThat(foundProducts).containsExactlyInAnyOrder(product1, product2)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment