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

FIWARE / contract-management / #67

27 Oct 2025 12:33PM UTC coverage: 1.686% (+0.04%) from 1.651%
#67

Pull #12

wistefan
wait for the policy
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

0.0
/src/main/java/org/fiware/iam/tmforum/handlers/TMForumEventHandler.java
1
package org.fiware.iam.tmforum.handlers;
2

3
import io.micronaut.core.annotation.Nullable;
4
import io.micronaut.http.HttpRequest;
5
import io.micronaut.http.HttpResponse;
6
import io.micronaut.http.HttpStatus;
7
import lombok.extern.slf4j.Slf4j;
8
import reactor.core.publisher.Mono;
9

10
import java.util.Arrays;
11
import java.util.List;
12
import java.util.Map;
13

14
/**
15
 * Handler for events generated by the TMForum
16
 */
17
public interface TMForumEventHandler {
18

19
    /**
20
     * Return if the given handler implementation supports the given event type
21
     */
22
    boolean isEventTypeSupported(String eventType);
23

24
    /**
25
     * Handle the concrete event
26
     */
27
    Mono<HttpResponse<?>> handleEvent(String eventType, Map<String, Object> event);
28

29
    /**
30
     * Zip a list of HttpResponse Mono's. Return a success code in case all are fine, else a bad-gateway
31
     */
32
    default Mono<HttpResponse<?>> zipToResponse(List<Mono<HttpResponse<?>>> responses) {
NEW
33
        if (responses.isEmpty()) {
×
NEW
34
            return Mono.just(HttpResponse.noContent());
×
35
        }
NEW
36
        return Mono.zipDelayError(responses, objects -> Arrays.stream(objects)
×
NEW
37
                .filter(HttpResponse.class::isInstance)
×
NEW
38
                .map(HttpResponse.class::cast)
×
NEW
39
                .filter(response -> response.getStatus().getCode() < 200 || response.getStatus().getCode() > 299)
×
NEW
40
                .findAny()
×
NEW
41
                .map(response -> HttpResponse.status(HttpStatus.BAD_GATEWAY).body(response.body()))
×
NEW
42
                .orElse(HttpResponse.noContent()));
×
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