use of com.tvd12.ezyfox.bean.EzyPrototypeFactory in project ezyfox-server by youngmonkeys.
the class EzyUserRequestPrototypeControllerTest method test.
@Test
public void test() {
// given
EzyPrototypeFactory prototypeFactory = mock(EzyPrototypeFactory.class);
when(prototypeFactory.getSuppliers(EzyRequestListener.class)).thenReturn(Collections.emptyList());
EzyBeanContext beanContext = mock(EzyBeanContext.class);
when(beanContext.getPrototypeFactory()).thenReturn(prototypeFactory);
InternalController sut = new InternalController.Builder().beanContext(beanContext).build();
// when
EzyAppContext appContext = mock(EzyAppContext.class);
EzyUserRequestEvent event = mock(EzyUserRequestEvent.class);
String cmd = RandomUtil.randomShortAlphabetString();
EzyHandler handler = mock(EzyHandler.class);
sut.postHandle(appContext, event, cmd, handler);
// then
verify(beanContext, times(1)).getPrototypeFactory();
verify(beanContext, times(1)).getSingleton("unmarshaller", EzyUnmarshaller.class);
}
Aggregations