Skip to content

Commit 26feacf

Browse files
author
Chris Wilson
committed
Adds explicit tests for EndPoint adding a single leading / to the beginning of a URI.
1 parent ab45901 commit 26feacf

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

libs/sparkpost-lib/src/test/java/com/sparkpost/EndPointTest.java

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,39 @@ public void setUp() {
3434
public void tearDown() {
3535
}
3636

37+
/**
38+
* Test of "/" is added to empty Endoint
39+
*/
40+
@Test
41+
public void testSimpleEmptyEndPoint() {
42+
Endpoint endPoint = new Endpoint("");
43+
44+
String result = endPoint.toString();
45+
Assert.assertEquals("/", result);
46+
}
47+
48+
/**
49+
* Test if "/" URI starts with only one `/`
50+
*/
51+
@Test
52+
public void testSimpleEmptyEndPoint2() {
53+
Endpoint endPoint = new Endpoint("/");
54+
55+
String result = endPoint.toString();
56+
Assert.assertEquals("/", result);
57+
}
58+
59+
/**
60+
* Test if "/" URI starts with only one `/`
61+
*/
62+
@Test
63+
public void testSimpleEndPointLeadingSlash() {
64+
Endpoint endPoint = new Endpoint("/test");
65+
66+
String result = endPoint.toString();
67+
Assert.assertEquals("/test", result);
68+
}
69+
3770
/**
3871
* Test of Simple EndPoint
3972
*/

0 commit comments

Comments
 (0)