@@ -90,7 +90,7 @@
Loading
90 90
91 91
    private void storeAndPost(A aggregate, DispatchOutcome outcome) {
92 92
        Success success = outcome.getSuccess();
93 -
        if (success.hasProducedEvents()) {
93 +
        if (success.hasEvents()) {
94 94
            store(aggregate);
95 95
            List<Event> events = success.getProducedEvents()
96 96
                                        .getEventList();
@@ -126,7 +126,7 @@
Loading
126 126
    final DispatchOutcome handleAndApplyEvents(A aggregate) {
127 127
        DispatchOutcome outcome = invokeDispatcher(aggregate);
128 128
        Success successfulOutcome = outcome.getSuccess();
129 -
        return successfulOutcome.hasProducedEvents()
129 +
        return successfulOutcome.hasEvents()
130 130
               ? applyProducedEvents(aggregate, outcome)
131 131
               : outcome;
132 132
    }

@@ -49,4 +49,24 @@
Loading
49 49
                return getField(field);
50 50
        }
51 51
    }
52 +
53 +
    /**
54 +
     * Determines if the outcome has any produced events.
55 +
     *
56 +
     * @implNote Prefer using this method over the generated {@code hasProducedEvents}
57 +
     *         while the latter only checks if the message is set.
58 +
     */
59 +
    default boolean hasEvents() {
60 +
        return hasProducedEvents() && getProducedEvents().getEventCount() > 0;
61 +
    }
62 +
63 +
    /**
64 +
     * Determines if the outcome has any produced commands.
65 +
     *
66 +
     * @implNote Prefer using this method over the generated {@code hasProducedCommands}
67 +
     *         while the latter only checks if the message is set.
68 +
     */
69 +
    default boolean hasCommands() {
70 +
        return hasProducedCommands() && getProducedCommands().getCommandCount() > 0;
71 +
    }
52 72
}
Files Complexity Coverage
client/src/main/java/io/spine 86.74% 87.62%
core/src/main/java/io/spine 90.20% 93.87%
model 57.69% 52.02%
server/src/main/java/io/spine 88.88% 92.00%
testutil-client/src/main/java/io/spine/testing/client 94.74% 87.37%
testutil-core/src/main/java/io/spine/testing/core/given 92.86% 97.73%
testutil-server/src/main/java/io/spine/testing/server 90.11% 90.46%
Project Totals (614 files) 88.55% 91.04%
8165.1
TRAVIS_OS_NAME=linux
openjdk8=
8157.1
TRAVIS_OS_NAME=linux
openjdk8=
1
#
2
# See default configuration here: https://github.com/codecov/support/blob/master/codecov.yml
3
#
4
# For more options see: https://gist.github.com/stevepeak/53bee7b2c326b24a9b4a
5
#
6
# Codecov documentation is available here: https://codecov.io/docs
7

8
coverage:
9
  ignore:
10
  - generated/*
11
  - examples/*
12
  - test/*
13
  status:
14
    patch: false
15

16
comment:
17
  layout: "header, diff, changes, uncovered"
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading