use of com.developmentontheedge.be5.api.Response in project be5 by DevelopmentOnTheEdge.
the class MainServletTest method runUnknownComponent.
@Test
public void runUnknownComponent() throws Exception {
String componentId = "foo";
Request req = mock(Request.class);
Response res = mock(Response.class);
spyMainServlet.runComponent(componentId, req, res);
verify(req).setAttribute("testRequestPreprocessor", "testProject");
verify(res).sendError(eq(Be5Exception.unknownComponent("foo")));
}
use of com.developmentontheedge.be5.api.Response in project be5 by DevelopmentOnTheEdge.
the class LanguageSelectorTest method generateSelect.
@Test
public void generateSelect() throws Exception {
Response response = mock(Response.class);
Request request = getSpyMockRequest("select", ImmutableMap.of("language", "RU"));
component.generate(request, response, injector);
verify(response).sendAsRawJson(eq(languageSelectorResponse));
}
use of com.developmentontheedge.be5.api.Response 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.api.Response 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.api.Response 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));
}
Aggregations