BAEL-3201 - Updated test method names

This commit is contained in:
Abhinav Pandey 2022-07-10 19:14:31 +05:30 committed by GitHub
parent 282cd67ad4
commit bc4857f6be
1 changed files with 5 additions and 5 deletions

View File

@ -15,7 +15,7 @@ public class ProductServiceIntegrationTest {
static { static {
GenericContainer<?> redis = new GenericContainer<>(DockerImageName.parse("redis:5.0.3-alpine")) GenericContainer<?> redis = new GenericContainer<>(DockerImageName.parse("redis:5.0.3-alpine"))
.withExposedPorts(6379); .withExposedPorts(6379);
redis.start(); redis.start();
System.setProperty("spring.redis.host", redis.getHost()); System.setProperty("spring.redis.host", redis.getHost());
System.setProperty("spring.redis.port", redis.getMappedPort(6379).toString()); System.setProperty("spring.redis.port", redis.getMappedPort(6379).toString());
@ -25,7 +25,7 @@ public class ProductServiceIntegrationTest {
private ProductService productService; private ProductService productService;
@Test @Test
void testCreateProduct() { void givenProductCreated_whenGettingProductById_thenProductExistsAndHasSameProperties() {
Product product = new Product("1", "Test Product", 10.0); Product product = new Product("1", "Test Product", 10.0);
productService.createProduct(product); productService.createProduct(product);
Product productFromDb = productService.getProduct("1"); Product productFromDb = productService.getProduct("1");
@ -35,7 +35,7 @@ public class ProductServiceIntegrationTest {
} }
@Test @Test
void testUpdateProduct() { void givenProductCreatedAndUpdated_whenGettingTheProduct_thenUpdatedProductReturned() {
Product product = new Product("1", "Test Product", 10.0); Product product = new Product("1", "Test Product", 10.0);
productService.createProduct(product); productService.createProduct(product);
Product productFromDb = productService.getProduct("1"); Product productFromDb = productService.getProduct("1");
@ -51,7 +51,7 @@ public class ProductServiceIntegrationTest {
} }
@Test @Test
void testDeleteProduct() { void givenProductCreatedAndDeleted_whenGettingTheProduct_thenNoProductReturned() {
Product product = new Product("1", "Test Product", 10.0); Product product = new Product("1", "Test Product", 10.0);
productService.createProduct(product); productService.createProduct(product);
Product productFromDb = productService.getProduct("1"); Product productFromDb = productService.getProduct("1");
@ -64,7 +64,7 @@ public class ProductServiceIntegrationTest {
} }
@Test @Test
void testGetProduct() { void givenProductCreated_whenGettingProductById_thenSameProductReturned() {
Product product = new Product("1", "Test Product", 10.0); Product product = new Product("1", "Test Product", 10.0);
productService.createProduct(product); productService.createProduct(product);
Product productFromDb = productService.getProduct("1"); Product productFromDb = productService.getProduct("1");