Skip to content

FragmentsRendering, add getViews or similar to facilitate Unit Tests #35775

@MalukuSeito

Description

@MalukuSeito

When writing Unit-Tests for my controllers, I noticed that the modelAndViews list of FragmentsRendering is not accessible anywhere, effectively preventing me from write Tests that ensure the right views have been added to the FragmentRendering. Furthermore, the way the Builder is invoked prevents effective mocking of the FragmentsRenderingBuilder. Leaving only reflection to access the content. There should be a better way:

FragmentsRendering fragments = adminController.deleteUser(authenticationMock, "mockid", httpServletRequestMock);
// asssertThat(fragments .getViews()).hasSize(2); // This does not work

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions