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

FIWARE / contract-management / #103

30 Sep 2026 02:39PM UTC coverage: 4.528% (+0.7%) from 3.796%
#103

Pull #28

vramperez
Address review: keep the standard stacktrace, only add the downstream answer

- DownstreamError no longer rewrites the cause chain into a custom format; it
  only adds what the stacktrace lacks: status and body of the downstream
  answer a failure was caused by
- The single place logging a failure attaches the exception, so the standard
  stacktrace is printed once per failure (subscription retries and faulty
  client requests stay one line)
- Removed remaining duplicate logs: the ContractManagementController and
  Oid4VpAuthHandler logged errors that are propagated and logged again; the
  OID4VP token failure is wrapped with client and scope instead

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Pull Request #28: Add failure reasons, downstream error descriptions and configurable log output

213 of 403 new or added lines in 35 files covered. (52.85%)

11 existing lines in 7 files now uncovered.

1621 of 35799 relevant lines covered (4.53%)

0.05 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/notification/NotificationListener.java
1
package org.fiware.iam.tmforum.notification;
2

3
import io.micronaut.context.annotation.Requires;
4
import io.micronaut.http.HttpResponse;
5
import io.micronaut.http.annotation.Body;
6
import io.micronaut.http.annotation.Controller;
7
import io.micronaut.http.annotation.Post;
8
import lombok.RequiredArgsConstructor;
9
import lombok.extern.slf4j.Slf4j;
10
import org.fiware.iam.configuration.NotificationProperties;
11
import org.fiware.iam.tmforum.handlers.TMForumEventHandler;
12
import reactor.core.publisher.Mono;
13

14
import java.util.List;
15
import java.util.Map;
16

17
/**
18
 * Listener endpoint for TMForum notifications
19
 */
20
@Requires(condition = NotificationProperties.NotificationCondition.class)
21
@Slf4j
×
22
@Controller("${general.basepath:/}")
23
@RequiredArgsConstructor
24
public class NotificationListener {
25

26
    public static final String EVENT_TYPE_KEY = "eventType";
27
    private static final String EVENT_ID_KEY = "eventId";
28

29
    private final List<TMForumEventHandler> eventHandlers;
30

31
    @Post("/listener/event")
32
    public Mono<HttpResponse<?>> listenToEvent(@Body Map<String, Object> event) {
33
        log.debug("Received an Event: {}", event);
×
34
        if (!event.containsKey(EVENT_TYPE_KEY)) {
×
NEW
35
            throw new IllegalArgumentException("The notification does not contain an eventType, it contains only %s.".formatted(event.keySet()));
×
36
        }
37

38
        if (event.get(EVENT_TYPE_KEY) instanceof String eventType) {
×
NEW
39
            log.info("Received {} notification {}.", eventType, event.getOrDefault(EVENT_ID_KEY, "without eventId"));
×
40
            return eventHandlers.stream()
×
41
                    .filter(handler -> handler.isEventTypeSupported(eventType))
×
42
                    .findAny()
×
43
                    .orElseThrow(() -> new IllegalArgumentException("Event type %s is not supported.".formatted(eventType)))
×
44
                    .handleEvent(eventType, event)
×
NEW
45
                    .doOnNext(r -> log.debug("Answered {} with {}.", eventType, r.getStatus().getCode()));
×
46
        }
NEW
47
        throw new IllegalArgumentException("The eventType of the notification is not a string, but %s.".formatted(event.get(EVENT_TYPE_KEY)));
×
48
    }
49
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc