Search in sources :

Example 1 with BibleInformationService

use of com.tyndalehouse.step.core.service.BibleInformationService in project step by STEPBible.

the class FrontControllerTest method testGetControllerMethod.

/**
 * tests that resolving method works
 *
 * @throws IllegalAccessException    uncaught exception
 * @throws InvocationTargetException uncaught exception
 */
@Test
public void testGetControllerMethod() throws IllegalAccessException, InvocationTargetException {
    final BibleInformationService bibleInfo = mock(BibleInformationService.class);
    final BibleController controllerInstance = new BibleController(bibleInfo, this.clientSessionProvider, null);
    // when
    final Method controllerMethod = this.fcUnderTest.getControllerMethod("getAllFeatures", controllerInstance, null, null);
    // then
    controllerMethod.invoke(controllerInstance);
    verify(bibleInfo).getAllFeatures();
}
Also used : BibleInformationService(com.tyndalehouse.step.core.service.BibleInformationService) Method(java.lang.reflect.Method) BibleController(com.tyndalehouse.step.rest.controllers.BibleController) Test(org.junit.Test)

Example 2 with BibleInformationService

use of com.tyndalehouse.step.core.service.BibleInformationService in project step by STEPBible.

the class IndexAll method main.

/**
 * main method
 *
 * @param args list of arguments
 */
public static void main(final String[] args) {
    final BibleInformationService instance = Guice.createInjector(new StepCoreModule(), new Module() {

        @Override
        public void configure(final Binder binder) {
            binder.bind(ClientSession.class).toProvider(new Provider<ClientSession>() {

                @Override
                public ClientSession get() {
                    // TODO Auto-generated method stub
                    return null;
                }
            });
        }
    }).getInstance(BibleInformationService.class);
    instance.indexAll();
}
Also used : Binder(com.google.inject.Binder) BibleInformationService(com.tyndalehouse.step.core.service.BibleInformationService) ClientSession(com.tyndalehouse.step.core.models.ClientSession) StepCoreModule(com.tyndalehouse.step.core.guice.StepCoreModule) Module(com.google.inject.Module) StepCoreModule(com.tyndalehouse.step.core.guice.StepCoreModule)

Aggregations

BibleInformationService (com.tyndalehouse.step.core.service.BibleInformationService)2 Binder (com.google.inject.Binder)1 Module (com.google.inject.Module)1 StepCoreModule (com.tyndalehouse.step.core.guice.StepCoreModule)1 ClientSession (com.tyndalehouse.step.core.models.ClientSession)1 BibleController (com.tyndalehouse.step.rest.controllers.BibleController)1 Method (java.lang.reflect.Method)1 Test (org.junit.Test)1