Skip to content

Implement DTO Instance Generation Based on Swagger Annotations #75

@yyytir777

Description

@yyytir777

In Controller-Level tests (@WebMvcTest), service layer logic is not executed. Therefore, instead of using entity instances, DTO instances should be directly used in test cases.

To simplify and automate this process, a feature will be implemented that generats DTO instances based on Swagger Annnotations (@Schema, @Parameter , etc).

Example

public class MockaTest {

    @Autowired SpringGeneratorFactory springGeneratorFactory;

    @Test
    void create_member() {
        EntityGenerator<ExperienceCreateRequestDto> generator = springGeneratorFactory.getGenerator(ExperienceCreateRequestDto.class);
        ExperienceCreateRequestDto requestDto = generator.get();
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions