Code example for MapBindingResult

0
    @Mock 
    private TeamRepository teamRepository;
 
    @Before 
    public void setup() { 
        bindingResult = new MapBindingResult(new HashMap<>(), "postForm");
        principal = () -> "12345";
 
        controller = new BlogAdminController(blogService, teamRepository, dateFactory); 
    } 
 
    @Test
    public void dashboardShowsUsersPosts() { 
        controller = new BlogAdminController(blogService, teamRepository, dateFactory);
 
        Page<Post> drafts = new PageImpl<>(
                Arrays.asList(new Post("draft post", "body", PostCategory.ENGINEERING)),
                PageableFactory.forDashboard(), 1); 
        Page<Post> scheduled = new PageImpl<>(
                Arrays.asList(new Post("scheduled post", "body", PostCategory.ENGINEERING)),