11import org .json .JSONArray ;
22import org .json .JSONObject ;
33import org .junit .jupiter .api .Disabled ;
4+ import org .junit .jupiter .api .DisplayName ;
45import org .junit .jupiter .api .Test ;
56
67import static org .assertj .core .api .Assertions .assertThat ;
78
89public class RestApiTest {
910
1011 @ Test
12+ @ DisplayName ("no users" )
1113 public void noUsers () {
1214 String expected =
1315 new JSONObject ().put ("users" , new JSONArray ()).toString ();
@@ -18,6 +20,7 @@ public void noUsers() {
1820
1921 @ Disabled ("Remove to run test" )
2022 @ Test
23+ @ DisplayName ("add user" )
2124 public void addUser () {
2225 String expected = new JSONObject ()
2326 .put ("name" , "Adam" )
@@ -33,6 +36,7 @@ public void addUser() {
3336
3437 @ Disabled ("Remove to run test" )
3538 @ Test
39+ @ DisplayName ("get single user" )
3640 public void getSingleUser () {
3741 String expected = new JSONObject ()
3842 .put (
@@ -56,6 +60,7 @@ public void getSingleUser() {
5660 }
5761
5862 @ Test
63+ @ DisplayName ("both users have 0 balance" )
5964 public void bothUsersHave0Balance () {
6065 String expected =
6166 new JSONObject ()
@@ -94,6 +99,7 @@ public void bothUsersHave0Balance() {
9499
95100 @ Disabled ("Remove to run test" )
96101 @ Test
102+ @ DisplayName ("borrower has negative balance" )
97103 public void borrowerHasNegativeBalance () {
98104 String expected =
99105 new JSONObject ()
@@ -135,6 +141,7 @@ public void borrowerHasNegativeBalance() {
135141
136142 @ Disabled ("Remove to run test" )
137143 @ Test
144+ @ DisplayName ("lender has negative balance" )
138145 public void lenderHasNegativeBalance () {
139146 String expected =
140147 new JSONObject ()
@@ -178,6 +185,7 @@ public void lenderHasNegativeBalance() {
178185
179186 @ Disabled ("Remove to run test" )
180187 @ Test
188+ @ DisplayName ("lender owes borrower" )
181189 public void lenderOwesBorrower () {
182190 String expected =
183191 new JSONObject ()
@@ -216,6 +224,7 @@ public void lenderOwesBorrower() {
216224
217225 @ Disabled ("Remove to run test" )
218226 @ Test
227+ @ DisplayName ("lender owes borrower less than new loan" )
219228 public void lenderOwesBorrowerLessThanNewLoan () {
220229 String expected =
221230 new JSONObject ()
@@ -254,6 +263,7 @@ public void lenderOwesBorrowerLessThanNewLoan() {
254263
255264 @ Disabled ("Remove to run test" )
256265 @ Test
266+ @ DisplayName ("lender owes borrower same as new loan" )
257267 public void lenderOwesBorrowerSameAsNewLoan () {
258268 String expected =
259269 new JSONObject ()
0 commit comments