Skip to content

Conversation

@AlberteMB
Copy link

  • Controllers: In the MenuItemController, I handle the creation of both subclasses (Dessert and MainCourse). By using the annotations @JsonTypeInfo and @JsonSubTypes, I only need to specify the Type field in each "PUT" request via Swagger.

  • DataLoader: Each subclass is created with its own specific attributes.

  • Test: Verifying if methods from the MenuItem interface can be used effectively in each subclass.

First steps in test for superclass and subclasses.
Adding new services.
MenuItemSuperclass test: Passed!
- DataLoader adding new faker for each subclass Dessert and MainCourse.
- Adding empty constructor in MainCourse and Dessert for testing via Swagger.
- Adding JsonIgnore in superclass MenuItem to focus only in subclasses via Swagger.
- Adding JsonTypeInfo and JsonSubTypes to decide which subclass is been generated via Swagger (Type="dessert" or Type="mainCourse" needed)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants