@SuppressWarnings("unchecked")
@Test
public void testExecuteCustomResultSerializer() {
JacksonJsonRedisSerializer<Person> personSerializer = new JacksonJsonRedisSerializer<Person>(Person.class);
this.template = new RedisTemplate<String, Person>();
template.setKeySerializer(new StringRedisSerializer());
template.setValueSerializer(personSerializer);
template.setConnectionFactory(connFactory);
template.afterPropertiesSet();
DefaultRedisScript<String> script = new DefaultRedisScript<String>();
script.setScriptSource(new StaticScriptSource("redis.call('SET',KEYS[1], ARGV[1])\nreturn 'FOO'"));
script.setResultType(String.class);
ScriptExecutor<String> scriptExecutor = new DefaultScriptExecutor<String>(template);
Person joe = new Person("Joe", "Schmoe", 23);
String result = scriptExecutor.execute(script, personSerializer, new StringRedisSerializer(),
Collections.singletonList("bar"), joe);
assertEquals("FOO", result);
assertEquals(joe, template.boundValueOps("bar").get());
}