title: Embedded Redis server fails to start
body: <p>I have a Springboot project and as part of my tests I use embedded Redis server. When I run a specific test class with Intellij it works fine and tests pass. But when I use <code>mvn clean test</code> command to run tests I receive the following error:</p>
  <blockquote>
  <p>BeanCreationException: Error creating bean with name
  'core.config.TestRedisConfiguration': Invocation of init method
  failed; nested exception is java.lang.RuntimeException: Can't start
  redis server. Check logs for details.</p>
  </blockquote>
  <p>This is the dependency in my pom.xml file:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;dependency&gt;
      &lt;groupId&gt;com.github.kstyrc&lt;/groupId&gt;
      &lt;artifactId&gt;embedded-redis&lt;/artifactId&gt;
      &lt;version&gt;0.6&lt;/version&gt;
      &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  </code></pre>
  <p>And this is my TestRedisConfiguration class:</p>
  <pre class="lang-kotlin prettyprint-override"><code>import org.springframework.beans.factory.annotation.Value
  import org.springframework.boot.test.context.TestConfiguration
  import redis.embedded.RedisServer
  import redis.embedded.RedisServerBuilder
  import javax.annotation.PostConstruct
  import javax.annotation.PreDestroy
  
  @TestConfiguration
  class TestRedisConfiguration(@Value(&quot;\${redis.port:63799}&quot;) private val port: Int) {
  
      private val redisServer: RedisServer
  
      init {
          redisServer = RedisServerBuilder().port(port).build()
      }
  
      @PostConstruct
      fun postConstruct() {
          redisServer.start()
      }
  
      @PreDestroy
      fun preDestroy() {
          redisServer.stop()
      }
  }
  </code></pre>