use of com.developmentontheedge.be5.api.Response in project be5 by DevelopmentOnTheEdge.
the class MenuTest method testDefaultActionAdmin.
@Test
public void testDefaultActionAdmin() {
initUserWithRoles(RoleType.ROLE_ADMINISTRATOR, RoleType.ROLE_SYSTEM_DEVELOPER);
Response response = mock(Response.class);
component.generate(getMockRequest("defaultAction"), response, injector);
verify(response).sendAsRawJson(eq(new Action("call", "table/testtableAdmin/All records")));
initUserWithRoles(RoleType.ROLE_GUEST);
}
use of com.developmentontheedge.be5.api.Response in project be5 by DevelopmentOnTheEdge.
the class MenuTest method testUnknownAction.
@Test
public void testUnknownAction() {
Response response = mock(Response.class);
component.generate(getMockRequest("foo"), response, injector);
verify(response).sendUnknownActionError();
}
use of com.developmentontheedge.be5.api.Response in project be5 by DevelopmentOnTheEdge.
the class MenuTest method testDefaultActionTestUser2.
@Test
public void testDefaultActionTestUser2() {
initUserWithRoles("TestUser2");
Response response = mock(Response.class);
component.generate(getMockRequest("defaultAction"), response, injector);
verify(response).sendAsRawJson(eq(new Action("call", "table/atest/Test1")));
initUserWithRoles(RoleType.ROLE_GUEST);
}
use of com.developmentontheedge.be5.api.Response in project be5 by DevelopmentOnTheEdge.
the class StaticPageComponentTest method generate.
@Test
public void generate() throws Exception {
Response response = mock(Response.class);
String page = "info.be";
Request req = getSpyMockRequest(page, ImmutableMap.of(TIMESTAMP_PARAM, "123456789"));
component.generate(req, response, injector);
// todo verify(response).sendAsJson(eq(new ResourceData(STATIC_ACTION,
// new StaticPagePresentation("", "<h1>Info</h1><p>Test text.</p>"))),
// eq(ImmutableMap.of(TIMESTAMP_PARAM, "123456789")),
// eq(Collections.singletonMap(SELF_LINK, "static/" + page)));
verify(response).sendAsJson(any(ResourceData.class), any(Map.class));
}
Aggregations