mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 12:09:16 +00:00
Merge branch '4.0.x'
Closes gh-50357
This commit is contained in:
+8
-3
@@ -16,7 +16,10 @@
|
||||
|
||||
package smoketest.cache;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
import com.redis.testcontainers.RedisContainer;
|
||||
import org.awaitility.Awaitility;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.testcontainers.junit.jupiter.Container;
|
||||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
@@ -52,9 +55,11 @@ class SampleCacheApplicationRedisTests {
|
||||
countries.clear(); // Simple test assuming the cache is empty
|
||||
assertThat(countries.get("BE")).isNull();
|
||||
Country be = this.countryRepository.findByCode("BE");
|
||||
ValueWrapper belgium = countries.get("BE");
|
||||
assertThat(belgium).isNotNull();
|
||||
assertThat((Country) belgium.get()).isEqualTo(be);
|
||||
Awaitility.waitAtMost(Duration.ofSeconds(10)).untilAsserted(() -> {
|
||||
ValueWrapper belgium = countries.get("BE");
|
||||
assertThat(belgium).isNotNull();
|
||||
assertThat((Country) belgium.get()).isEqualTo(be);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user