use of com.tvd12.ezyfoxserver.request.EzySimplePluginInfoRequest in project ezyfox-server by youngmonkeys.
the class EzyPluginInfoControllerTest method test.
@Test
public void test() {
EzyPluginInfoController controller = new EzyPluginInfoController();
EzyServerContext serverContext = mock(EzyServerContext.class);
EzyZoneContext zoneContext = mock(EzyZoneContext.class);
when(serverContext.getZoneContext(1)).thenReturn(zoneContext);
EzySimplePluginInfoRequest request = new EzySimplePluginInfoRequest();
EzyAbstractSession session = spy(EzyAbstractSession.class);
EzySimpleUser user = new EzySimpleUser();
user.setZoneId(1);
request.setSession(session);
request.setUser(user);
EzyArray data = EzyEntityFactory.newArrayBuilder().append("test").build();
request.deserializeParams(data);
controller.handle(serverContext, request);
EzyPluginContext pluginContext = mock(EzyPluginContext.class);
EzySimplePlugin plugin = new EzySimplePlugin();
EzySimplePluginSetting pluginSetting = new EzySimplePluginSetting();
plugin.setSetting(pluginSetting);
when(pluginContext.getPlugin()).thenReturn(plugin);
when(zoneContext.getPluginContext("test")).thenReturn(pluginContext);
controller.handle(serverContext, request);
}
Aggregations