You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You are working on a project that uses Spring MVC,Spring WebFlux,JDBC to build RESTful APIs.
16
-
You MUST use should_xx_xx style for test method name.
17
-
You MUST use given-when-then style.
18
-
- Test file should be complete and compilable, without need for further actions.
19
-
- Ensure that each test focuses on a single use case to maintain clarity and readability.
20
-
- Instead of using `@BeforeEach` methods for setup, include all necessary code initialization within each individual test method, do not write parameterized tests.
21
-
| This project uses JUnit 5, you should import `org.junit.jupiter.api.Test` and use `@Test` annotation.- You MUST use MockMvc and test API only.
22
-
- Use appropriate Spring test annotations such as `@MockBean`, `@Autowired`, `@WebMvcTest`, `@DataJpaTest`, `@AutoConfigureTestDatabase`, `@AutoConfigureMockMvc`, `@SpringBootTest` etc.
23
-
24
-
25
-
// here are related classes:
26
-
// class BlogService {
27
-
// blogRepository
28
-
// + public BlogPost createBlog(BlogPost blogDto)
29
-
// + public BlogPost getBlogById(Long id)
30
-
// + public BlogPost updateBlog(Long id, BlogPost blogDto)
31
-
// + public void deleteBlog(Long id)
32
-
// }
33
-
```java
34
-
@ApiOperation(value = "Create a new blog")
35
-
@PostMapping("/")
36
-
public BlogPost createBlog(@RequestBody CreateBlogRequest request) {
37
-
CreateBlogResponse response = new CreateBlogResponse();
You are working on a project that uses Spring MVC,Spring WebFlux,JDBC to build RESTful APIs.
16
+
You MUST use should_xx_xx style for test method name.
17
+
You MUST use given-when-then style.
18
+
- Test file should be complete and compilable, without need for further actions.
19
+
- Ensure that each test focuses on a single use case to maintain clarity and readability.
20
+
- Instead of using `@BeforeEach` methods for setup, include all necessary code initialization within each individual test method, do not write parameterized tests.
21
+
| This project uses JUnit 5, you should import `org.junit.jupiter.api.Test` and use `@Test` annotation.- You MUST use MockMvc and test API only.
22
+
- Use appropriate Spring test annotations such as `@MockBean`, `@Autowired`, `@WebMvcTest`, `@DataJpaTest`, `@AutoConfigureTestDatabase`, `@AutoConfigureMockMvc`, `@SpringBootTest` etc.
0 commit comments