use of io.lettuce.core.dynamic.segment.CommandSegments in project lettuce-core by lettuce-io.
the class ReactiveCommandSegmentCommandFactoryUnitTests method createCommand.
RedisCommand<?, ?, ?> createCommand(String methodName, Class<?> interfaceClass, Class<?>... parameterTypes) {
Method method = ReflectionUtils.findMethod(interfaceClass, methodName, parameterTypes);
CommandMethod commandMethod = DeclaredCommandMethod.create(method);
AnnotationCommandSegmentFactory segmentFactory = new AnnotationCommandSegmentFactory();
CommandSegments commandSegments = segmentFactory.createCommandSegments(commandMethod);
ReactiveCommandSegmentCommandFactory factory = new ReactiveCommandSegmentCommandFactory(commandSegments, commandMethod, new StringCodec(), outputFactoryResolver);
return factory.createCommand(new Object[] { "foo" });
}
use of io.lettuce.core.dynamic.segment.CommandSegments in project lettuce-core by lettuce-io.
the class DefaultCommandMethodVerifierUnitTests method validateMethod.
private void validateMethod(String methodName, Class<?>... parameterTypes) {
Method method = ReflectionUtils.findMethod(MyInterface.class, methodName, parameterTypes);
CommandSegmentFactory commandSegmentFactory = new AnnotationCommandSegmentFactory();
CommandMethod commandMethod = DeclaredCommandMethod.create(method);
CommandSegments commandSegments = commandSegmentFactory.createCommandSegments(commandMethod);
sut.validate(commandSegments, commandMethod);
}
Aggregations