Search in sources :

Example 1 with RemoteServerApiConfiguration

use of com.stanfy.enroscar.rest.RemoteServerApiConfiguration in project enroscar by stanfy.

the class RemoteServerApiConfigurationTest method configureBean.

@Before
public void configureBean() {
    BeansManager manager = BeansManager.get(Robolectric.application);
    manager.edit().put("defaultCacheBeanName", new DummyResponseCache()).put("defaultContentHandlerName", new StringContentHandler(Robolectric.application)).put(RemoteServerApiConfiguration.class).commit();
    RemoteServerApiConfiguration config = manager.getContainer().getBean(RemoteServerApiConfiguration.class);
    config.setDefaultCacheBeanName("defaultCacheBeanName");
    config.setDefaultContentHandlerName("defaultContentHandlerName");
}
Also used : BeansManager(com.stanfy.enroscar.beans.BeansManager) StringContentHandler(com.stanfy.enroscar.rest.response.handler.StringContentHandler) RemoteServerApiConfiguration(com.stanfy.enroscar.rest.RemoteServerApiConfiguration) DummyResponseCache(com.stanfy.enroscar.net.test.cache.DummyResponseCache) Before(org.junit.Before)

Example 2 with RemoteServerApiConfiguration

use of com.stanfy.enroscar.rest.RemoteServerApiConfiguration in project enroscar by stanfy.

the class RemoteServerApiConfigurationTest method badCacheBeanNameShouldThrow.

@Test(expected = IllegalArgumentException.class)
public void badCacheBeanNameShouldThrow() {
    RemoteServerApiConfiguration config = BeansManager.get(Robolectric.application).getContainer().getBean(RemoteServerApiConfiguration.class);
    config.setDefaultCacheBeanName("bad");
}
Also used : RemoteServerApiConfiguration(com.stanfy.enroscar.rest.RemoteServerApiConfiguration) Test(org.junit.Test)

Example 3 with RemoteServerApiConfiguration

use of com.stanfy.enroscar.rest.RemoteServerApiConfiguration in project enroscar by stanfy.

the class RemoteServerApiConfigurationTest method badContentHandlerBeanNameShouldThrow.

@Test(expected = IllegalArgumentException.class)
public void badContentHandlerBeanNameShouldThrow() {
    RemoteServerApiConfiguration config = BeansManager.get(Robolectric.application).getContainer().getBean(RemoteServerApiConfiguration.class);
    config.setDefaultContentHandlerName("bad");
}
Also used : RemoteServerApiConfiguration(com.stanfy.enroscar.rest.RemoteServerApiConfiguration) Test(org.junit.Test)

Aggregations

RemoteServerApiConfiguration (com.stanfy.enroscar.rest.RemoteServerApiConfiguration)3 Test (org.junit.Test)2 BeansManager (com.stanfy.enroscar.beans.BeansManager)1 DummyResponseCache (com.stanfy.enroscar.net.test.cache.DummyResponseCache)1 StringContentHandler (com.stanfy.enroscar.rest.response.handler.StringContentHandler)1 Before (org.junit.Before)1