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

hazendaz / jmockit1 / 496

15 Nov 2025 05:33PM UTC coverage: 72.192% (-0.008%) from 72.2%
496

push

github

web-flow
Merge pull request #412 from hazendaz/renovate/major-spring-core

Update spring core to v7 (major)

5677 of 8360 branches covered (67.91%)

Branch coverage included in aggregate %.

11922 of 16018 relevant lines covered (74.43%)

0.74 hits per line

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

76.0
/main/src/main/java/mockit/internal/expectations/invocation/InvocationResult.java
1
/*
2
 * MIT License
3
 * Copyright (c) 2006-2025 JMockit developers
4
 * See LICENSE file for full license text.
5
 */
6
package mockit.internal.expectations.invocation;
7

8
import edu.umd.cs.findbugs.annotations.NonNull;
9
import edu.umd.cs.findbugs.annotations.Nullable;
10

11
import java.util.Iterator;
12

13
class InvocationResult {
1✔
14
    InvocationResult next;
15

16
    @Nullable
17
    Object produceResult(@NonNull Object[] args) throws Throwable {
18
        return null;
×
19
    }
20

21
    @Nullable
22
    Object produceResult(@Nullable Object invokedObject, @NonNull ExpectedInvocation invocation,
23
            @NonNull InvocationConstraints constraints, @NonNull Object[] args) throws Throwable {
24
        return produceResult(args);
1✔
25
    }
26

27
    static final class ReturnValueResult extends InvocationResult {
28
        @Nullable
29
        private final Object returnValue;
30

31
        ReturnValueResult(@Nullable Object returnValue) {
1✔
32
            this.returnValue = returnValue;
1✔
33
        }
1✔
34

35
        @Nullable
36
        @Override
37
        Object produceResult(@NonNull Object[] args) {
38
            return returnValue;
1✔
39
        }
40
    }
41

42
    static final class ThrowableResult extends InvocationResult {
43
        @NonNull
44
        private final Throwable throwable;
45

46
        ThrowableResult(@NonNull Throwable throwable) {
1✔
47
            this.throwable = throwable;
1✔
48
        }
1✔
49

50
        @NonNull
51
        @Override
52
        Object produceResult(@NonNull Object[] args) throws Throwable {
53
            throwable.fillInStackTrace();
1✔
54
            throw throwable;
1✔
55
        }
56
    }
57

58
    static final class DeferredResults extends InvocationResult {
59
        @NonNull
60
        private final Iterator<?> values;
61

62
        DeferredResults(@NonNull Iterator<?> values) {
1✔
63
            this.values = values;
1✔
64
        }
1✔
65

66
        @Nullable
67
        @Override
68
        Object produceResult(@NonNull Object[] args) throws Throwable {
69
            Object nextValue = values.hasNext() ? values.next() : null;
1!
70

71
            if (nextValue instanceof Throwable) {
1!
72
                Throwable t = (Throwable) nextValue;
×
73
                t.fillInStackTrace();
×
74
                throw t;
×
75
            }
76

77
            return nextValue;
1✔
78
        }
79
    }
80
}
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