### Question:
AppInitializer { public static void run() { HerokuRedis redis = HerokuRedis.get(); if (redis != null) { System.setProperty("spring.redis.host", redis.getHost()); System.setProperty("spring.redis.password", redis.getPassword()); System.setProperty("spring.redis.port", Integer.toString(redis.getPort())); } }  static void run();  }### Answer:
@Test @SneakyThrows public void runTest() { HerokuRedis redis = mock(HerokuRedis.class); when(redis.getHost()).thenReturn("host"); when(redis.getPassword()).thenReturn("password"); when(redis.getPort()).thenReturn(12345); mockStatic(HerokuRedis.class); when(HerokuRedis.get()).thenReturn(redis); System.clearProperty("spring.redis.host"); System.clearProperty("spring.redis.password"); System.clearProperty("spring.redis.port"); AppInitializer.run(); assertEquals("host", System.getProperty("spring.redis.host")); assertEquals("password", System.getProperty("spring.redis.password")); assertEquals("12345", System.getProperty("spring.redis.port")); }