From bc4857f6be7142ca7855efce6bbc77700fe4ecf0 Mon Sep 17 00:00:00 2001 From: Abhinav Pandey Date: Sun, 10 Jul 2022 19:14:31 +0530 Subject: [PATCH] BAEL-3201 - Updated test method names --- .../service/ProductServiceIntegrationTest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spring-boot-modules/spring-boot-testing-2/src/test/java/com/baeldung/redistestcontainers/service/ProductServiceIntegrationTest.java b/spring-boot-modules/spring-boot-testing-2/src/test/java/com/baeldung/redistestcontainers/service/ProductServiceIntegrationTest.java index 55ff2b8676..519db1b335 100644 --- a/spring-boot-modules/spring-boot-testing-2/src/test/java/com/baeldung/redistestcontainers/service/ProductServiceIntegrationTest.java +++ b/spring-boot-modules/spring-boot-testing-2/src/test/java/com/baeldung/redistestcontainers/service/ProductServiceIntegrationTest.java @@ -15,7 +15,7 @@ public class ProductServiceIntegrationTest { static { GenericContainer redis = new GenericContainer<>(DockerImageName.parse("redis:5.0.3-alpine")) - .withExposedPorts(6379); + .withExposedPorts(6379); redis.start(); System.setProperty("spring.redis.host", redis.getHost()); System.setProperty("spring.redis.port", redis.getMappedPort(6379).toString()); @@ -25,7 +25,7 @@ public class ProductServiceIntegrationTest { private ProductService productService; @Test - void testCreateProduct() { + void givenProductCreated_whenGettingProductById_thenProductExistsAndHasSameProperties() { Product product = new Product("1", "Test Product", 10.0); productService.createProduct(product); Product productFromDb = productService.getProduct("1"); @@ -35,7 +35,7 @@ public class ProductServiceIntegrationTest { } @Test - void testUpdateProduct() { + void givenProductCreatedAndUpdated_whenGettingTheProduct_thenUpdatedProductReturned() { Product product = new Product("1", "Test Product", 10.0); productService.createProduct(product); Product productFromDb = productService.getProduct("1"); @@ -51,7 +51,7 @@ public class ProductServiceIntegrationTest { } @Test - void testDeleteProduct() { + void givenProductCreatedAndDeleted_whenGettingTheProduct_thenNoProductReturned() { Product product = new Product("1", "Test Product", 10.0); productService.createProduct(product); Product productFromDb = productService.getProduct("1"); @@ -64,7 +64,7 @@ public class ProductServiceIntegrationTest { } @Test - void testGetProduct() { + void givenProductCreated_whenGettingProductById_thenSameProductReturned() { Product product = new Product("1", "Test Product", 10.0); productService.createProduct(product); Product productFromDb = productService.getProduct("1");