Przeglądaj źródła

FakeZinc: fixed issue in builder

Jonathan LALOU 7 lat temu
rodzic
commit
f385cff6ab

+ 7
- 6
src/main/java/fr/sayasoft/fake/zinc/FakeZincController.java Wyświetl plik

@@ -81,7 +81,7 @@ public class FakeZincController {
81 81
      */
82 82
     @SuppressWarnings("unused")
83 83
     @RequestMapping(
84
-            value = "/v1/orders",
84
+            value = "/v1/order",
85 85
             method = RequestMethod.POST,
86 86
             produces = "application/json; charset=UTF-8"
87 87
     )
@@ -92,11 +92,12 @@ public class FakeZincController {
92 92
         try {
93 93
             final ZincErrorCode zincErrorCode;
94 94
             zincErrorCode = ZincErrorCode.valueOf(orderRequest.getClientNotes().toString());
95
-            final ZincError zincError = new ZincError(
96
-                    zincErrorCode,
97
-                    zincErrorCode.getMeaning(),
98
-                    orderRequest.getIdempotencyKey()
99
-            );
95
+            final ZincError zincError = ZincError.builder()
96
+                    .code(zincErrorCode)
97
+                    .message(zincErrorCode.getMeaning())
98
+                    .orderRequest(orderRequest)
99
+                    .build()
100
+                    ;
100 101
             log.info("Received request to generate error code, returning: " + zincError);
101 102
             /*
102 103
             Precision obtained from Zinc support: although an error message is returned, the HTTP header is a 200