Java Code Examples for play.test.Helpers#start()

The following examples show how to use play.test.Helpers#start() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BaseApplicationTest.java    From sunbird-lms-service with MIT License 6 votes vote down vote up
public <T> void setup(Class<T> actorClass) {
  try {
    application =
        new GuiceApplicationBuilder()
            .in(new File("path/to/app"))
            .in(Mode.TEST)
            .disable(StartModule.class)
            .build();
    Helpers.start(application);
    system = ActorSystem.create("system");
    props = Props.create(actorClass);
    ActorRef subject = system.actorOf(props);
    BaseController.setActorRef(subject);
    AccessLogFilter filter = PowerMockito.mock(AccessLogFilter.class);
    PowerMockito.mockStatic(RequestInterceptor.class);
    PowerMockito.mockStatic(TelemetryWriter.class);
    PowerMockito.when(RequestInterceptor.verifyRequestData(Mockito.any())).thenReturn("userId");
    PowerMockito.mockStatic(OnRequestHandler.class);
    PowerMockito.doReturn("12345678990").when(OnRequestHandler.class, "getCustodianOrgHashTagId");
  } catch (Exception e) {
    e.printStackTrace();
  }
}
 
Example 2
Source File: InfoExtractorTest.java    From dr-elephant with Apache License 2.0 4 votes vote down vote up
@Before
public void startApp() throws Exception {
  app = Helpers.fakeApplication(Helpers.inMemoryDatabase());
  Helpers.start(app);
}
 
Example 3
Source File: ApplicationTest.java    From dr-elephant with Apache License 2.0 4 votes vote down vote up
@BeforeClass
public static void startApp() {
  app = Helpers.fakeApplication(Helpers.inMemoryDatabase());
  Helpers.start(app);
}
 
Example 4
Source File: FakeApplicationTest.java    From htwplus with MIT License 4 votes vote down vote up
@BeforeClass
public static void startApp() {
    app = Helpers.fakeApplication();
    Helpers.start(app);
}
 
Example 5
Source File: SitemapControllerTest.java    From play-sitemap-module.edulify.com with Apache License 2.0 4 votes vote down vote up
@BeforeClass
public static void startApp() {
  application = Helpers.fakeApplication();
  Helpers.start(application);
}
 
Example 6
Source File: AnnotationUrlProviderTest.java    From play-sitemap-module.edulify.com with Apache License 2.0 4 votes vote down vote up
@BeforeClass
public static void startApp() {
  application = Helpers.fakeApplication();
  Helpers.start(application);
}