All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.playtika.testcontainer.redis.wait.RedisStatusCheck Maven / Gradle / Ivy

There is a newer version: 3.1.9
Show newest version
package com.playtika.testcontainer.redis.wait;

import com.playtika.testcontainer.common.checks.AbstractCommandWaitStrategy;
import com.playtika.testcontainer.redis.RedisProperties;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@RequiredArgsConstructor
public class RedisStatusCheck extends AbstractCommandWaitStrategy {

    private final RedisProperties properties;

    @Override
    public String[] getCheckCommand() {
        if (properties.isRequirepass()) {
            return new String[]{
                    "redis-cli", "-a", properties.getPassword(), "-p", String.valueOf(properties.getPort()), "ping"
            };
        } else {
            return new String[]{
                    "redis-cli", "-p", String.valueOf(properties.getPort()), "ping"
            };
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy