Skip to content

Commit e80583f

Browse files
iluwatar#297 Create unit test for ImageController
1 parent 665256e commit e80583f

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

api-gateway/image-microservice/pom.xml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@
4040
<artifactId>spring-boot-starter-web</artifactId>
4141
<version>${spring-boot.version}</version>
4242
</dependency>
43+
<dependency>
44+
<groupId>junit</groupId>
45+
<artifactId>junit</artifactId>
46+
<scope>test</scope>
47+
</dependency>
4348
</dependencies>
4449

4550
<build>
@@ -58,12 +63,4 @@
5863
</plugin>
5964
</plugins>
6065
</build>
61-
62-
<!--<dependencies>-->
63-
<!--<dependency>-->
64-
<!--<groupId>junit</groupId>-->
65-
<!--<artifactId>junit</artifactId>-->
66-
<!--<scope>test</scope>-->
67-
<!--</dependency>-->
68-
<!--</dependencies>-->
6966
</project>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.iluwatar.image.microservice;
2+
3+
import org.junit.Assert;
4+
import org.junit.Test;
5+
6+
public class ImageControllerTest {
7+
@Test
8+
public void testGetImagePath() {
9+
ImageController imageController = new ImageController();
10+
11+
String imagePath = imageController.getImagePath();
12+
13+
Assert.assertEquals("/product-image.png", imagePath);
14+
}
15+
}

0 commit comments

Comments
 (0)