Pārlūkot izejas kodu

FakeZinc: updated request mapping

Jonathan LALOU 7 gadus atpakaļ
vecāks
revīzija
4fae29a948

+ 2
- 2
src/main/java/fr/sayasoft/fake/zinc/FakeZincController.java Parādīt failu

@@ -63,7 +63,7 @@ public class FakeZincController {
63 63
 
64 64
     @SuppressWarnings("unused")
65 65
     @RequestMapping(
66
-            value = "/v1/order/{request_id}",
66
+            value = "/v1/orders/{request_id}",
67 67
             method = RequestMethod.GET,
68 68
             produces = "application/json; charset=UTF-8"
69 69
     )
@@ -81,7 +81,7 @@ public class FakeZincController {
81 81
      */
82 82
     @SuppressWarnings("unused")
83 83
     @RequestMapping(
84
-            value = "/v1/order",
84
+            value = "/v1/orders",
85 85
             method = RequestMethod.POST,
86 86
             produces = "application/json; charset=UTF-8"
87 87
     )

+ 1
- 1
src/test/java/fr/sayasoft/fake/zinc/FakeZincControllerUnitTest.java Parādīt failu

@@ -110,7 +110,7 @@ public class FakeZincControllerUnitTest {
110 110
     @Test
111 111
     public void getOrder() throws Exception {
112 112
 
113
-        this.mockMvc.perform(get("/order/1234546"))
113
+        this.mockMvc.perform(get("/orders/1234546"))
114 114
                 .andDo(print()).andExpect(status().isOk())
115 115
                 .andExpect(content().string(FakeZincController.GET_ORDER_RESPONSE));
116 116
     }

+ 4
- 4
test/java/fr/sayasoft/fake/zinc/FakeZincControllerUnitTest.java Parādīt failu

@@ -170,14 +170,14 @@ public class FakeZincControllerUnitTest {
170 170
     @Test
171 171
     public void getOrder() throws Exception {
172 172
 
173
-        this.mockMvc.perform(get("/v1/order/1234546"))
173
+        this.mockMvc.perform(get("/v1/orders/1234546"))
174 174
                 .andDo(print()).andExpect(status().isOk())
175 175
                 .andExpect(content().string(FakeZincController.GET_ORDER_RESPONSE));
176 176
     }
177 177
 
178 178
     @Test
179 179
     public void postOrder_withString() throws Exception {
180
-        this.mockMvc.perform(post("/v1/order")
180
+        this.mockMvc.perform(post("/v1/orders")
181 181
                 .contentType(contentType)
182 182
                 .content(POST_ORDER_REQUEST))
183 183
                 .andDo(print())
@@ -189,7 +189,7 @@ public class FakeZincControllerUnitTest {
189 189
     public void postOrder_withObject() throws Exception {
190 190
         final String idempotencyKey = "Carina-β-Carinae-Miaplacidus";
191 191
         orderRequest.setIdempotencyKey(idempotencyKey);
192
-        this.mockMvc.perform(post("/v1/order")
192
+        this.mockMvc.perform(post("/v1/orders")
193 193
                 .contentType(contentType)
194 194
                 .content(new Gson().toJson(orderRequest)))
195 195
                 .andDo(print())
@@ -207,7 +207,7 @@ public class FakeZincControllerUnitTest {
207 207
         final MediaType contentType = new MediaType(MediaType.APPLICATION_JSON.getType(),
208 208
                 MediaType.APPLICATION_JSON.getSubtype(),
209 209
                 Charset.forName("utf8"));
210
-        this.mockMvc.perform(post("/v1/order")
210
+        this.mockMvc.perform(post("/v1/orders")
211 211
                 .contentType(contentType)
212 212
                 .content(new Gson().toJson(orderRequest)))
213 213
                 .andDo(print())