@Test public void shouldUseSentinelMasterName() { String name = "name"; RedisConnectionFactory factory = Mockito.mock(RedisConnectionFactory.class); RedisProperties props = new RedisProperties(); props.setSentinel(new Sentinel()); props.getSentinel().setMaster(name); RedisRelationshipDetector detector = new RedisRelationshipDetector(props, Arrays.asList(factory)); Set<Relationship> rels = new HashSet<>(); rels.add(Dependency.on(Component.of(name, ComponentType.REDIS))); Assertions.assertThat(detector.detect()).isEqualTo(rels); }
@Override public Set<Relationship> detect() { if (CollectionUtils.isEmpty(connectionFactories)) { return Collections.emptySet(); } String sentinelMaster = getRedisSentinelMasterName(); String name = StringUtils.hasText(sentinelMaster) ? sentinelMaster : defaultName; return Dependency.on(Component.of(name, ComponentType.REDIS)).asRelationshipSet(); }
RedisRelationshipDetector implements RelationshipDetector { @Override public Set<Relationship> detect() { if (CollectionUtils.isEmpty(connectionFactories)) { return Collections.emptySet(); } String sentinelMaster = getRedisSentinelMasterName(); String name = StringUtils.hasText(sentinelMaster) ? sentinelMaster : defaultName; return Dependency.on(Component.of(name, ComponentType.REDIS)).asRelationshipSet(); } }
RedisRelationshipDetector implements RelationshipDetector { @Override public Set<Relationship> detect() { if (CollectionUtils.isEmpty(connectionFactories)) { return Collections.emptySet(); } String sentinelMaster = getRedisSentinelMasterName(); String name = StringUtils.hasText(sentinelMaster) ? sentinelMaster : defaultName; return Dependency.on(Component.of(name, ComponentType.REDIS)).asRelationshipSet(); } RedisRelationshipDetector(RedisProperties redisProperties,
            List<RedisConnectionFactory> redisConnectionFactories); }
RedisRelationshipDetector implements RelationshipDetector { @Override public Set<Relationship> detect() { if (CollectionUtils.isEmpty(connectionFactories)) { return Collections.emptySet(); } String sentinelMaster = getRedisSentinelMasterName(); String name = StringUtils.hasText(sentinelMaster) ? sentinelMaster : defaultName; return Dependency.on(Component.of(name, ComponentType.REDIS)).asRelationshipSet(); } RedisRelationshipDetector(RedisProperties redisProperties,
            List<RedisConnectionFactory> redisConnectionFactories); @Override Set<Relationship> detect(); }
RedisRelationshipDetector implements RelationshipDetector { @Override public Set<Relationship> detect() { if (CollectionUtils.isEmpty(connectionFactories)) { return Collections.emptySet(); } String sentinelMaster = getRedisSentinelMasterName(); String name = StringUtils.hasText(sentinelMaster) ? sentinelMaster : defaultName; return Dependency.on(Component.of(name, ComponentType.REDIS)).asRelationshipSet(); } RedisRelationshipDetector(RedisProperties redisProperties,
            List<RedisConnectionFactory> redisConnectionFactories); @Override Set<Relationship> detect();  }