use of com.developmentontheedge.be5.api.Response in project be5 by DevelopmentOnTheEdge.
the class DocumentTest method generate.
@Test
public void generate() {
Response response = mock(Response.class);
component.generate(getSpyMockRequest("", ImmutableMap.of(RestApiConstants.ENTITY, "testtable", RestApiConstants.TIMESTAMP_PARAM, "" + new Date().getTime(), RestApiConstants.QUERY, "All records")), response, injector);
verify(response).sendAsJson(any(JsonApiModel.class));
}
use of com.developmentontheedge.be5.api.Response in project be5 by DevelopmentOnTheEdge.
the class DownloadComponentTest method test.
@Test
@Ignore
public void test() {
Response response = mock(Response.class);
Request req = getSpyMockRequest("", ImmutableMap.<String, String>builder().put("_t_", "attachments").put("_typeColumn_", "mimeType").put("_charsetColumn_", "mimeCharset").put("_filenameColumn_", "name").put("_dataColumn_", "data").put("_download_", "no").put("ID", "7326").build());
component.generate(req, response, injector);
}
use of com.developmentontheedge.be5.api.Response in project be5 by DevelopmentOnTheEdge.
the class MenuTest method test.
@Test
public void test() {
Response response = mock(Response.class);
component.generate(getMockRequest(""), response, injector);
verify(response).sendAsRawJson(isA(Menu.MenuResponse.class));
}
use of com.developmentontheedge.be5.api.Response in project be5 by DevelopmentOnTheEdge.
the class MenuTest method testDefaultAction.
@Test
public void testDefaultAction() {
Response response = mock(Response.class);
component.generate(getMockRequest("defaultAction"), response, injector);
verify(response).sendAsRawJson(eq(new Action("call", "table/testtable/All records")));
}
use of com.developmentontheedge.be5.api.Response in project be5 by DevelopmentOnTheEdge.
the class MenuTest method testDefaultActionUser.
@Test
public void testDefaultActionUser() {
initUserWithRoles("User");
Response response = mock(Response.class);
component.generate(getMockRequest("defaultAction"), response, injector);
verify(response).sendAsRawJson(eq(new Action("call", "table/testtUser/testtUser")));
initUserWithRoles(RoleType.ROLE_GUEST);
}
Aggregations