use of com.tyndalehouse.step.core.models.ClientSession 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();
}
use of com.tyndalehouse.step.core.models.ClientSession in project step by STEPBible.
the class FrontControllerTest method setUp.
/**
* Simply setting up the FrontController under test
*/
@Before
public void setUp() throws IOException {
final ClientSession clientSession = mock(ClientSession.class);
when(clientSession.getLocale()).thenReturn(Locale.ENGLISH);
when(this.clientSessionProvider.get()).thenReturn(clientSession);
final ObjectMapper mockMapper = mock(ObjectMapper.class);
when(mockMapper.writeValueAsString(any(Object.class))).thenReturn("Test");
when(this.objectMapper.get()).thenReturn(mockMapper);
this.fcUnderTest = new FrontController(this.guiceInjector, mock(AppManagerService.class), this.errorResolver, this.clientSessionProvider, objectMapper);
}
use of com.tyndalehouse.step.core.models.ClientSession in project step by STEPBible.
the class SupportController method createRequest.
/**
* Creates a support request in JIRA - this is a POST, so we need to get the parameters in manually ourselves
* rather than rely on reflection
*/
@Timed(name = "support-request", group = "analysis", rateUnit = TimeUnit.SECONDS, durationUnit = TimeUnit.MILLISECONDS)
public void createRequest() {
final ClientSession session = clientSession.get();
this.supportRequestService.createRequest(session.getParam("summary"), session.getParam("description"), session.getParam("url"), session.getParam("type"), session.getParam("email"));
}
Aggregations