use of com.tvd12.ezyfoxserver.context.EzyContext in project ezyfox-server by youngmonkeys.
the class EzyAbstractObjectResponseTest method exclude2Times.
@Test
public void exclude2Times() {
// given
EzyContext context = mock(EzyContext.class);
EzyMarshaller marshaller = mock(EzyMarshaller.class);
String excludeKey1 = RandomUtil.randomShortAlphabetString();
String excludeKey2 = RandomUtil.randomShortAlphabetString();
// when
EzyObjectResponse sut = new InternalObjectResponse(context, marshaller).exclude(excludeKey1).exclude(excludeKey2);
// then
Asserts.assertEquals(FieldUtil.getFieldValue(sut, "excludeParamKeys"), Sets.newHashSet(excludeKey1, excludeKey2));
}
use of com.tvd12.ezyfoxserver.context.EzyContext in project ezyfox-server by youngmonkeys.
the class EzyUserRequestInterceptorTest method preHandleTest.
@Test
public void preHandleTest() {
// given
EzyUserRequestInterceptor<EzyContext> sut = new EzyUserRequestInterceptor<EzyContext>() {
};
// when
// then
EzyContext context = mock(EzyContext.class);
EzyUserSessionEvent event = mock(EzyUserSessionEvent.class);
String command = RandomUtil.randomShortAlphabetString();
String data = RandomUtil.randomShortAlphabetString();
sut.preHandle(context, event, data, command);
sut.postHandle(context, event, data, command);
Exception e = new Exception("just test");
sut.postHandle(context, event, data, command, e);
}
Aggregations