@Test
public void testOnPMessage() {

  String sessionId = "test-id";
  byte[] pattern = SafeEncoder.encode("");
  byte[] goodChannel = SafeEncoder.encode("_keyspace:test:expired");
  byte[] notExpireChannel = SafeEncoder.encode("_keyspace:test:expared");
  byte[] shortChannel = SafeEncoder.encode("expir");
  byte[] goodKey = SafeEncoder.encode("myprefix:key:test-id");
  byte[] shortKey = SafeEncoder.encode("myprefi");
  expirationListener.onPMessage(pattern, null, goodKey);
  verify(sessionManager, never()).deleteAsync(sessionId, true);
  expirationListener.onPMessage(pattern, goodChannel, null);
  verify(sessionManager, never()).deleteAsync(sessionId, true);
  expirationListener.onPMessage(pattern, notExpireChannel, goodKey);
  verify(sessionManager, never()).deleteAsync(sessionId, true);
  expirationListener.onPMessage(pattern, shortChannel, goodKey);
  verify(sessionManager, never()).deleteAsync(sessionId, true);
  expirationListener.onPMessage(pattern, goodChannel, shortKey);
  verify(sessionManager, never()).deleteAsync(sessionId, true);
  expirationListener.onPMessage(pattern, goodChannel, goodKey);
  verify(sessionManager).deleteAsync(sessionId, true);
}