Search in sources :

Example 1 with Config

use of com.stanfy.enroscar.net.EnroscarConnectionsEngine.Config in project enroscar by stanfy.

the class AbstractMockServerTest method whenBeansConfigured.

@Override
protected void whenBeansConfigured() {
    super.whenBeansConfigured();
    BeansManager.get(getApplication()).getContainer().getBean(RemoteServerApiConfiguration.class).setDefaultRequestMethod(new RequestMethod() {

        @Override
        protected void before(final Context systemContext, final RequestDescription description) {
        // do not use TrafficStats
        }

        @Override
        protected void after(final Context systemContext, final RequestDescription description) {
        // do not use TrafficStats
        }
    });
    if (config == null) {
        config = BeanUtils.getAnnotationFromHierarchy(getClass(), EnroscarNetConfig.class);
    }
    if (config != null && config.connectionEngineRequired()) {
        final Config config = EnroscarConnectionsEngine.config();
        configureConnectionsEngine(config);
        config.treatFileScheme(false);
        config.setup(Robolectric.application);
    }
    configureServiceBind();
}
Also used : Context(android.content.Context) EnroscarNetConfig(com.stanfy.enroscar.test.EnroscarNetConfig) RemoteServerApiConfiguration(com.stanfy.enroscar.rest.RemoteServerApiConfiguration) RequestMethod(com.stanfy.enroscar.rest.RequestMethod) Config(com.stanfy.enroscar.net.EnroscarConnectionsEngine.Config) EnroscarNetConfig(com.stanfy.enroscar.test.EnroscarNetConfig) RequestDescription(com.stanfy.enroscar.net.operation.RequestDescription)

Aggregations

Context (android.content.Context)1 Config (com.stanfy.enroscar.net.EnroscarConnectionsEngine.Config)1 RequestDescription (com.stanfy.enroscar.net.operation.RequestDescription)1 RemoteServerApiConfiguration (com.stanfy.enroscar.rest.RemoteServerApiConfiguration)1 RequestMethod (com.stanfy.enroscar.rest.RequestMethod)1 EnroscarNetConfig (com.stanfy.enroscar.test.EnroscarNetConfig)1