use of com.developmentontheedge.be5.env.Injector 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.env.Injector 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));
}
use of com.developmentontheedge.be5.env.Injector in project be5 by DevelopmentOnTheEdge.
the class Be5InjectorCyclicDependenciesWithAnnotatedTest method injectWithAnnotatedBServiceFirst.
@Test
public void injectWithAnnotatedBServiceFirst() throws Exception {
Injector sqlMockInjector2 = Be5.createInjector(Stage.DEVELOPMENT, new SqlMockBinder());
sqlMockInjector2.get(BService.class).bMethodUseAService();
verify(SqlServiceMock.mock).update("aMethod sql");
sqlMockInjector2.get(AService.class).aMethodUseBService();
verify(SqlServiceMock.mock).update("bMethod sql");
}
use of com.developmentontheedge.be5.env.Injector in project be5 by DevelopmentOnTheEdge.
the class TestUtils method initInjector.
static Injector initInjector(Binder binder) {
Injector injector = Be5.createInjector(Stage.TEST, binder);
Project project = injector.getProject();
initProfile(project);
injector.get(UserHelper.class).initGuest(null);
return injector;
}
Aggregations