@Test public void nullSentinelShouldReturnDefaultComponentName() { RedisConnectionFactory factory = Mockito.mock(RedisConnectionFactory.class); RedisRelationshipDetector detector = new RedisRelationshipDetector(new RedisProperties(), Arrays.asList(factory)); Set<Relationship> rels = new HashSet<>(); rels.add(Dependency.on(Component.of("default", 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();  }