Examples of JSONResponse


Examples of org.jtalks.jcommune.web.dto.json.JsonResponse

    @Test
    public void savingLinkShouldPassIfNoValidationErrorsFound() throws Exception {
        when(bindingResult.hasErrors()).thenReturn(false);

        JsonResponse expected = controller.saveLink(link(), bindingResult);

        assertEquals(expected.getStatus(), JsonResponseStatus.SUCCESS);
        verify(service).saveLink(any(ExternalLink.class), any(Component.class));
    }
View Full Code Here

Examples of org.jtalks.jcommune.web.dto.json.JsonResponse

    @Test
    public void testFailValidationSaveLink() throws Exception {
        when(bindingResult.hasErrors()).thenReturn(true);

        JsonResponse expected = controller.saveLink(link(), bindingResult);

        assertEquals(expected.getStatus(), JsonResponseStatus.FAIL);
    }
View Full Code Here

Examples of org.jtalks.jcommune.web.dto.json.JsonResponse

    @Test
    public void testDeleteLink() throws Exception {
        boolean expectedResult = true;
        long id = 1L;
        doReturn(expectedResult).when(service).deleteLink(eq(id), any(Component.class));
        JsonResponse expected = controller.deleteLink(id);
        assertEquals(expected.getStatus(), JsonResponseStatus.SUCCESS);
        verify(service).deleteLink(eq(id), any(Component.class));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.