Search in sources :

Example 1 with StringCodec

use of io.lettuce.core.codec.StringCodec in project lettuce-core by lettuce-io.

the class OutputRegistryCommandOutputFactoryResolverUnitTests method getStreamingCommandOutput.

CommandOutput<?, ?, ?> getStreamingCommandOutput(String methodName) {
    OutputSelector outputSelector = getOutputSelector(methodName);
    CommandOutputFactory factory = resolver.resolveStreamingCommandOutput(unwrapReactiveType(outputSelector));
    return factory.create(new StringCodec());
}
Also used : StringCodec(io.lettuce.core.codec.StringCodec)

Example 2 with StringCodec

use of io.lettuce.core.codec.StringCodec in project lettuce-core by lettuce-io.

the class OutputRegistryCommandOutputFactoryResolverUnitTests method getCommandOutput.

CommandOutput<?, ?, ?> getCommandOutput(String methodName) {
    OutputSelector outputSelector = getOutputSelector(methodName);
    CommandOutputFactory factory = resolver.resolveCommandOutput(Publisher.class.isAssignableFrom(outputSelector.getOutputType().getRawClass()) ? unwrapReactiveType(outputSelector) : outputSelector);
    return factory.create(new StringCodec());
}
Also used : StringCodec(io.lettuce.core.codec.StringCodec)

Example 3 with StringCodec

use of io.lettuce.core.codec.StringCodec in project lettuce-core by lettuce-io.

the class OutputRegistryUnitTests method streamingTypeOfKeyListOuputWithCodecIsAssignableFromListOfString.

@Test
void streamingTypeOfKeyListOuputWithCodecIsAssignableFromListOfString() {
    OutputType outputComponentType = OutputRegistry.getStreamingType(ScoredValueListOutput.class);
    ResolvableType resolvableType = outputComponentType.withCodec(new StringCodec());
    assertThat(resolvableType.isAssignableFrom(ResolvableType.forClassWithGenerics(ScoredValue.class, String.class))).isTrue();
}
Also used : StringCodec(io.lettuce.core.codec.StringCodec) ResolvableType(io.lettuce.core.dynamic.support.ResolvableType) ScoredValue(io.lettuce.core.ScoredValue) Test(org.junit.jupiter.api.Test)

Example 4 with StringCodec

use of io.lettuce.core.codec.StringCodec in project lettuce-core by lettuce-io.

the class OutputRegistryUnitTests method componentTypeOfKeyListOuputWithCodecIsAssignableFromListOfString.

@Test
void componentTypeOfKeyListOuputWithCodecIsAssignableFromListOfString() {
    OutputType outputComponentType = OutputRegistry.getOutputComponentType(KeyListOutput.class);
    ResolvableType resolvableType = outputComponentType.withCodec(new StringCodec());
    assertThat(resolvableType.isAssignableFrom(ResolvableType.forClassWithGenerics(List.class, String.class))).isTrue();
}
Also used : StringCodec(io.lettuce.core.codec.StringCodec) List(java.util.List) ResolvableType(io.lettuce.core.dynamic.support.ResolvableType) Test(org.junit.jupiter.api.Test)

Example 5 with StringCodec

use of io.lettuce.core.codec.StringCodec in project lettuce-core by lettuce-io.

the class OutputRegistryUnitTests method componentTypeOfKeyOuputWithCodecIsAssignableFromString.

@Test
void componentTypeOfKeyOuputWithCodecIsAssignableFromString() {
    OutputType outputComponentType = OutputRegistry.getOutputComponentType(KeyOutput.class);
    ResolvableType resolvableType = outputComponentType.withCodec(new StringCodec());
    assertThat(resolvableType.isAssignableFrom(String.class)).isTrue();
}
Also used : StringCodec(io.lettuce.core.codec.StringCodec) ResolvableType(io.lettuce.core.dynamic.support.ResolvableType) Test(org.junit.jupiter.api.Test)

Aggregations

StringCodec (io.lettuce.core.codec.StringCodec)16 Test (org.junit.jupiter.api.Test)12 ResolvableType (io.lettuce.core.dynamic.support.ResolvableType)4 ScanArgs (io.lettuce.core.ScanArgs)1 ScoredValue (io.lettuce.core.ScoredValue)1 SetArgs (io.lettuce.core.SetArgs)1 Timeout (io.lettuce.core.dynamic.domain.Timeout)1 AnnotationCommandSegmentFactory (io.lettuce.core.dynamic.segment.AnnotationCommandSegmentFactory)1 CommandSegments (io.lettuce.core.dynamic.segment.CommandSegments)1 CommandArgs (io.lettuce.core.protocol.CommandArgs)1 Method (java.lang.reflect.Method)1 List (java.util.List)1