{
ApplicationStatePersistenceStrategy strategy = mockApplicationStatePersistenceStrategy();
ApplicationStatePersistenceStrategySource source = mockApplicationStatePersistenceStrategySource();
Class asoClass = ReadOnlyBean.class;
final Holder holder = new Holder();
ObjectLocator locator = mockObjectLocator();
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);
expect(locator.autobuild(EasyMock.isA(String.class), EasyMock.eq(asoClass))).andReturn(
new ReadOnlyBean());
replay();
Map<Class, ApplicationStateContribution> configuration = Collections.emptyMap();