22
33import com .uploadcare .api .File ;
44
5- import org .junit .Before ;
6- import org .junit .Test ;
5+ import org .junit .jupiter . api . BeforeEach ;
6+ import org .junit .jupiter . api . Test ;
77
88import java .awt .*;
99
10- import static org .junit .Assert .assertEquals ;
11- import static org .junit .Assert .fail ;
10+ import static org .junit .jupiter . api . Assertions .assertEquals ;
11+ import static org .junit .jupiter . api . Assertions .fail ;
1212import static org .mockito .Mockito .mock ;
1313import static org .mockito .Mockito .when ;
1414
15- public class CdnPathBuilderTest {
15+ class CdnPathBuilderTest {
1616
1717 private static final String FILE_ID = "27c7846b-a019-4516-a5e4-de635f822161" ;
1818 private CdnPathBuilder builder ;
1919
20- @ Before
21- public void setUp () {
20+ @ BeforeEach
21+ void setUp () {
2222 File file = mock (File .class );
2323 when (file .getFileId ()).thenReturn (FILE_ID );
2424
2525 builder = new CdnPathBuilder (file );
2626 }
2727
2828 @ Test
29- public void test_fileUrl () {
29+ void testFileUrl () {
3030 String path = builder .build ();
31+
3132 assertEquals ("/" + FILE_ID + "/" , path );
3233 }
3334
3435 @ Test
35- public void test_allOperations () {
36+ void testAllOperations () {
3637 String path = builder
3738 .crop (100 , 110 )
3839 .cropColor (120 , 130 , Color .BLACK )
@@ -82,13 +83,14 @@ public void test_allOperations() {
8283 }
8384
8485 @ Test
85- public void test_detectFaces () {
86+ void testDetectFaces () {
8687 String path = builder .detectFaces ().build ();
88+
8789 assertEquals ("/" + FILE_ID + "/detect_faces/" , path );
8890 }
8991
9092 @ Test
91- public void test_dimensionGuard () {
93+ void testDimensionGuard () {
9294 builder .resizeWidth (1 );
9395 builder .resizeWidth (2048 );
9496 try {
@@ -104,7 +106,7 @@ public void test_dimensionGuard() {
104106 }
105107
106108 @ Test
107- public void test_dimensionsGuard () {
109+ void testDimensionsGuard () {
108110 builder .resize (1024 , 634 );
109111 builder .resize (634 , 1024 );
110112 try {
0 commit comments