@SuppressWarnings("unchecked")
@Test
public void get_from_unconfigured_aso()
{
ApplicationStatePersistenceStrategy strategy = newApplicationStatePersistenceStrategy();
ApplicationStatePersistenceStrategySource source = newApplicationStatePersistenceStrategySource();
Class asoClass = ReadOnlyBean.class;
final Holder holder = new Holder();
train_get(source, ApplicationStateManagerImpl.DEFAULT_STRATEGY, strategy);
IAnswer answer = new IAnswer()
{
public Object answer() throws Throwable
{
ApplicationStateCreator creator = (ApplicationStateCreator) EasyMock
.getCurrentArguments()[1];
Object aso = creator.create();
holder.put(aso);
return aso;
}
};
expect(strategy.get(eq(asoClass), isA(ApplicationStateCreator.class))).andAnswer(answer);
replay();
Map<Class, ApplicationStateContribution> configuration = Collections.emptyMap();