Search in sources :

Example 1 with BoundHashOperations

use of org.springframework.data.redis.core.BoundHashOperations in project spring-cloud-config by spring-cloud.

the class RedisEnvironmentRepositoryIntegrationTests method test.

@Test
public void test() {
    BoundHashOperations bound = redis.boundHashOps("foo-bar");
    bound.put("name", "foo");
    bound.put("tag", "myapp");
    Environment env = new RedisEnvironmentRepository(redis, new RedisEnvironmentProperties()).findOne("foo", "bar", "");
    assertThat(env.getName()).isEqualTo("foo");
    assertThat(env.getPropertySources()).isNotEmpty();
    assertThat(env.getPropertySources().get(0).getSource().get("tag")).isEqualTo("myapp");
}
Also used : BoundHashOperations(org.springframework.data.redis.core.BoundHashOperations) Environment(org.springframework.cloud.config.environment.Environment) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

Test (org.junit.jupiter.api.Test)1 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)1 Environment (org.springframework.cloud.config.environment.Environment)1 BoundHashOperations (org.springframework.data.redis.core.BoundHashOperations)1