"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/src/redisTest/java/smoketest/cache/SampleCacheApplicationRedisTests.java" between
spring-boot-2.7.3.tar.gz and spring-boot-2.7.4.tar.gz

About: Spring Boot helps to create Spring-powered, production-grade applications and services.

SampleCacheApplicationRedisTests.java  (spring-boot-2.7.3):SampleCacheApplicationRedisTests.java  (spring-boot-2.7.4)
skipping to change at line 48 skipping to change at line 48
private static final RedisContainer redis = new RedisContainer(); private static final RedisContainer redis = new RedisContainer();
@Autowired @Autowired
private CacheManager cacheManager; private CacheManager cacheManager;
@Autowired @Autowired
private CountryRepository countryRepository; private CountryRepository countryRepository;
@DynamicPropertySource @DynamicPropertySource
static void redisProperties(DynamicPropertyRegistry properties) { static void redisProperties(DynamicPropertyRegistry properties) {
properties.add("spring.redis.url", properties.add("spring.redis.url", () -> "redis://" + redis.getHo
() -> "redis://" + redis.getContainerIpAddress() st() + ":" + redis.getFirstMappedPort());
+ ":" + redis.getFirstMappedPort());
} }
@Test @Test
void validateCache() { void validateCache() {
Cache countries = this.cacheManager.getCache("countries"); Cache countries = this.cacheManager.getCache("countries");
assertThat(countries).isNotNull(); assertThat(countries).isNotNull();
countries.clear(); // Simple test assuming the cache is empty countries.clear(); // Simple test assuming the cache is empty
assertThat(countries.get("BE")).isNull(); assertThat(countries.get("BE")).isNull();
Country be = this.countryRepository.findByCode("BE"); Country be = this.countryRepository.findByCode("BE");
assertThat((Country) countries.get("BE").get()).isEqualTo(be); assertThat((Country) countries.get("BE").get()).isEqualTo(be);
 End of changes. 1 change blocks. 
3 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)