
package org.apache.geode.redis.internal.executor;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import java.util.regex.Pattern;

import org.junit.Test;
import org.junit.experimental.categories.Category;

import org.apache.geode.test.junit.categories.RedisTest;

@Category({RedisTest.class})
public class AbstractScanExecutorTest {

  @Test
  public void shouldBeMockable() throws Exception {
    AbstractScanExecutor mockAbstractScanExecutor = mock(AbstractScanExecutor.class);
    Pattern pattern = Pattern.compile(".");

    when(mockAbstractScanExecutor.convertGlobToRegex(eq("pattern"))).thenReturn(pattern);

    assertThat(mockAbstractScanExecutor.convertGlobToRegex("pattern")).isSameAs(pattern);
  }
}
