Conversation
- Add annotation for parsing to DTO - Add method to convert YAML to DTO - Add test code for conversion logic
| public class Position { | ||
|
|
||
| private Integer x; | ||
| private Integer y; |
There was a problem hiding this comment.
Is there a particular reason you used the Integer wrapper class for the coordinate values?
There was a problem hiding this comment.
I think If the YAML is generated from the CLI, it could contain null values.
| public class Position { | ||
|
|
||
| private Integer x; | ||
| private Integer y; |
There was a problem hiding this comment.
What do you think about using names like positionX and positionY instead of just x and y?
| if (response != null) { | ||
| System.out.println(" response #" + (i + 1)); | ||
|
|
||
| // when 출력 |
|
Other than that, everything looks great. Awesome work! LGTM 👍👍 |
| /** | ||
| * HTTP methods (GET, POST .etc) | ||
| */ | ||
| private String method; |
There was a problem hiding this comment.
I think it would be better to manage it with enum.
There was a problem hiding this comment.
You could take a look at my code for reference—it might help!
| /** | ||
| * HTTP or WEBSOCKET | ||
| */ | ||
| private String type; |
There was a problem hiding this comment.
I think it would be better to manage it with enum.
There was a problem hiding this comment.
You could take a look at my code for reference—it might help! ✌️
| /** | ||
| * status of response ex. "200-299" or 200 | ||
| */ | ||
| private Object status; |
There was a problem hiding this comment.
The object's type definition may benefit from improved type safety.
There was a problem hiding this comment.
I think String would be a better choice here.
|
|
||
| /** | ||
| * 파일 경로로부터 시나리오 YAML을 파싱 | ||
| * |
There was a problem hiding this comment.
Please write comments in English.
| System.out.println("\nSteps information:"); | ||
| for (int i = 0; i < scenario.getSteps().size(); i++) { | ||
| Scenario.Step step = scenario.getSteps().get(i); | ||
| System.out.println("Step " + (i + 1) + ": " + step.getName()); |
There was a problem hiding this comment.
It seems that System.out.println is used quite frequently. Would using StringBuilder or another approach be more efficient?
|
|
||
| // 각 스텝 정보 출력 | ||
| System.out.println("\nSteps information:"); | ||
| for (int i = 0; i < scenario.getSteps().size(); i++) { |
There was a problem hiding this comment.
It might be more efficient to avoid calling scenario.getSteps().size() on each iteration of the loop.
| Scenario scenario = reader.readScenario(filePath); | ||
|
|
||
| System.out.println("===== 변환된 Scenario 객체 정보 ====="); | ||
| System.out.println("===== converted Scenario information ====="); |
There was a problem hiding this comment.
Please avoid using System.out.println in test logic! 🏆
| } | ||
| } | ||
|
|
||
| // steps 출력 (null 체크) |
There was a problem hiding this comment.
Could you remove the Kr-Comment??
| ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory()); | ||
|
|
||
| File yamlFile = new File(yamlFilePath); | ||
| Scenario scenario = objectMapper.readValue(yamlFile, Scenario.class); |
There was a problem hiding this comment.
I think we need to handle an IOException here.
| private String name; | ||
| private String description; | ||
| private String scenarioId; | ||
| private Integer timeoutMs; |
There was a problem hiding this comment.
I think it's better to use long type to represent microseconds.
|
Appreciated the hardwork @sung-jun98 |
Related Issue
Description
Testing
Additional Notes
Pre-Submission Checklist