• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

FIWARE / contract-management / #68

29 Oct 2025 11:26AM UTC coverage: 1.686% (+0.04%) from 1.651%
#68

Pull #12

wistefan
fixes from pr review
Pull Request #12: Support for central marketplace and policy creation

117 of 1238 new or added lines in 31 files covered. (9.45%)

5 existing lines in 2 files now uncovered.

587 of 34807 relevant lines covered (1.69%)

0.02 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

36.36
/src/main/java/org/fiware/iam/tmforum/notification/SubscriptionHealthIndicator.java
1
package org.fiware.iam.tmforum.notification;
2

3
import io.micronaut.context.annotation.Requires;
4
import io.micronaut.core.async.publisher.AsyncSingleResultPublisher;
5
import io.micronaut.health.HealthStatus;
6
import io.micronaut.management.health.indicator.HealthIndicator;
7
import io.micronaut.management.health.indicator.HealthResult;
8
import jakarta.inject.Singleton;
9
import org.fiware.iam.configuration.NotificationProperties;
10
import org.reactivestreams.Publisher;
11

12
import java.util.LinkedHashMap;
13
import java.util.Map;
14
import java.util.Optional;
15

16
/**
17
 * Indicator to collect the existence of all configured subscriptions towards TMForum
18
 */
19
@Requires(condition = NotificationProperties.NotificationCondition.class)
20
@Singleton
21
public class SubscriptionHealthIndicator implements HealthIndicator {
1✔
22

23
    private final Map<String, Boolean> registrationMap = new LinkedHashMap<>();
1✔
24

25
    @Override
26
    public Publisher<HealthResult> getResult() {
27

NEW
28
        HealthResult.Builder healthResultBuilder = HealthResult.builder("Subscription Health");
×
NEW
29
        Optional<Boolean> optionalUnhealthy = registrationMap.values().stream().filter(key -> !key).findAny();
×
NEW
30
        if (optionalUnhealthy.isPresent()) {
×
NEW
31
            return new AsyncSingleResultPublisher<>(() -> healthResultBuilder.status(HealthStatus.DOWN).build());
×
32
        } else {
NEW
33
            return new AsyncSingleResultPublisher<>(() -> healthResultBuilder.status(HealthStatus.UP).build());
×
34
        }
35
    }
36

37
    public void initiateSubscriptionInMap(String key) {
38
        registrationMap.put(key, false);
1✔
39
    }
1✔
40

41
    public void setSubscriptionHealthy(String key) {
NEW
42
        registrationMap.put(key, true);
×
NEW
43
    }
×
44

45
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc