DATAKV-62
+ fixed incorrect method invocation
This commit is contained in:
@@ -538,14 +538,14 @@ public class RedisTemplate<K, V> extends RedisAccessor implements RedisOperation
|
||||
public Set<K> keys(K pattern) {
|
||||
final byte[] rawKey = rawKey(pattern);
|
||||
|
||||
Collection<byte[]> rawKeys = execute(new RedisCallback<Collection<byte[]>>() {
|
||||
Set<byte[]> rawKeys = execute(new RedisCallback<Set<byte[]>>() {
|
||||
@Override
|
||||
public Collection<byte[]> doInRedis(RedisConnection connection) {
|
||||
public Set<byte[]> doInRedis(RedisConnection connection) {
|
||||
return connection.keys(rawKey);
|
||||
}
|
||||
}, true);
|
||||
|
||||
return (Set<K>) SerializationUtils.deserialize(rawKeys, keySerializer);
|
||||
return SerializationUtils.deserialize(rawKeys, keySerializer);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright 2011 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.keyvalue.redis.core;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
import org.junit.runners.Parameterized.Parameters;
|
||||
import org.springframework.data.keyvalue.redis.ConnectionFactoryTracker;
|
||||
import org.springframework.data.keyvalue.redis.support.collections.CollectionTestParams;
|
||||
import org.springframework.data.keyvalue.redis.support.collections.ObjectFactory;
|
||||
|
||||
/**
|
||||
* @author Costin Leau
|
||||
*/
|
||||
@RunWith(Parameterized.class)
|
||||
public class TemplateTest {
|
||||
private ObjectFactory<Object> objFactory;
|
||||
private RedisTemplate template;
|
||||
|
||||
public TemplateTest(ObjectFactory<Object> objFactory, RedisTemplate template) {
|
||||
this.objFactory = objFactory;
|
||||
this.template = template;
|
||||
ConnectionFactoryTracker.add(template.getConnectionFactory());
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void cleanUp() {
|
||||
ConnectionFactoryTracker.cleanUp();
|
||||
}
|
||||
|
||||
@Parameters
|
||||
public static Collection<Object[]> testParams() {
|
||||
return CollectionTestParams.testParams();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testKeys() throws Exception {
|
||||
assertTrue(template.keys("*") != null);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user