use of com.developmentontheedge.be5.env.Injector in project be5 by DevelopmentOnTheEdge.
the class LanguageSelectorTest method generate.
@Test
public void generate() throws Exception {
Response response = mock(Response.class);
component.generate(getMockRequest(""), response, injector);
verify(response).sendAsRawJson(eq(languageSelectorResponse));
}
use of com.developmentontheedge.be5.env.Injector in project be5 by DevelopmentOnTheEdge.
the class LanguageSelectorTest method generateLanguageParameterIsAbsent.
@Test
public void generateLanguageParameterIsAbsent() throws Exception {
expectedEx.expect(Be5Exception.class);
expectedEx.expectMessage(ErrorTitles.formatTitle(Be5ErrorCode.PARAMETER_ABSENT, "language"));
Response response = mock(Response.class);
component.generate(getSpyMockRequest("select"), response, injector);
}
use of com.developmentontheedge.be5.env.Injector in project be5 by DevelopmentOnTheEdge.
the class MenuTest method testWithIds.
@Test
public void testWithIds() {
Response response = mock(Response.class);
component.generate(getMockRequest("withIds"), response, injector);
verify(response).sendAsRawJson(isA(Menu.MenuResponse.class));
}
use of com.developmentontheedge.be5.env.Injector 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.env.Injector 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();
}
Aggregations