Skip to content

Commit 9cdadd2

Browse files
committed
fix: fix erro action again
1 parent 9dba8db commit 9cdadd2

File tree

2 files changed

+35
-36
lines changed

2 files changed

+35
-36
lines changed

docs/development/test-prompts.md

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,38 @@ permalink: /scenes/domain-drive-design
88

99
## Test Prompts
1010

11-
Write unit test for following code.
12-
You MUST return method code only, no explain.
13-
You MUST return start with @Test annotation.
14-
You MUST Use English to reply me!
15-
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();
38-
BlogPost blogPost = new BlogPost();
39-
BeanUtils.copyProperties(request, blogPost);
40-
BlogPost createdBlog = blogService.createBlog(blogPost);
41-
BeanUtils.copyProperties(createdBlog, response);
42-
return createdBlog;
43-
}
44-
```
11+
Write unit test for following code.
12+
You MUST return method code only, no explain.
13+
You MUST return start with @Test annotation.
14+
You MUST Use English to reply me!
15+
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.
4523

46-
Start test code with `@Test` syntax here:
24+
// here are related classes:
25+
// 'filePath: /Users/phodal/IdeaProjects/untitled/src/main/java/cc/unitmesh/untitled/demo/service/BlogService.java
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();
38+
BlogPost blogPost = new BlogPost();
39+
BeanUtils.copyProperties(request, blogPost);
40+
BlogPost createdBlog = blogService.createBlog(blogPost);
41+
BeanUtils.copyProperties(createdBlog, response);
42+
return createdBlog;
43+
}
44+
```
45+
Start test code with `@Test` syntax here:

src/main/kotlin/cc/unitmesh/devti/context/ClassContext.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package cc.unitmesh.devti.context
22

33
import cc.unitmesh.devti.context.base.NamedElementContext
4+
import com.intellij.openapi.application.runReadAction
45
import com.intellij.psi.PsiElement
56
import com.intellij.psi.PsiReference
6-
import org.jetbrains.kotlin.idea.util.application.runReadAction
77

88
class ClassContext(
99
override val root: PsiElement,

0 commit comments

Comments
 (0)