Skip to content

Commit f5ac7bf

Browse files
committed
Update in PaymentController
1 parent dbcf058 commit f5ac7bf

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

payment-service-paypal/src/main/java/com/example/paymentservicepaypal/TestController.java renamed to payment-service-paypal/src/main/java/com/example/paymentservicepaypal/PaymentController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
@RestController
88
@RequestMapping("/hello")
9-
public class TestController {
9+
public class PaymentController {
1010

1111
@GetMapping
1212
public String sayHello() {
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
package com.example.paymentservicepaypal;
22

33
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
4+
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
45
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
56

67
import org.junit.jupiter.api.Test;
78
import org.springframework.beans.factory.annotation.Autowired;
89
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
910
import org.springframework.test.web.servlet.MockMvc;
1011

11-
@WebMvcTest(TestController.class)
12+
@WebMvcTest(PaymentController.class)
1213
public class PaymentControllerTest {
13-
14-
@Autowired
15-
private MockMvc mockMvc;
1614

17-
@Test
18-
void testGetPaymentStatus() throws Exception {
19-
mockMvc.perform(get("/api/payments/status"))
20-
.andExpect(status().isOk());
21-
}
15+
@Autowired
16+
private MockMvc mockMvc;
17+
18+
@Test
19+
void testSayHello() throws Exception {
20+
mockMvc.perform(get("/hello")).andExpect(status().isOk())
21+
.andExpect(content().string("hello from Paypal Payment Service"));
22+
}
2223
}

0 commit comments

Comments
 (0)