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

zalando / logbook / #4471

04 Mar 2024 07:51PM CUT coverage: 100.0%. Remained the same
#4471

push

web-flow
Add a warning about logbook.write.max-body-size not preventing the buffering (#1777)

3539 of 3539 relevant lines covered (100.0%)

1.0 hits per line

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

100.0
/logbook-api/src/main/java/org/zalando/logbook/attributes/HttpAttributes.java
1
package org.zalando.logbook.attributes;
2

3
import lombok.experimental.Delegate;
4
import org.apiguardian.api.API;
5

6
import javax.annotation.Nonnull;
7
import javax.annotation.concurrent.Immutable;
8
import java.util.Collections;
9
import java.util.HashMap;
10
import java.util.Map;
11

12
import static org.apiguardian.api.API.Status.EXPERIMENTAL;
13

14
@Immutable
15
@API(status = EXPERIMENTAL)
16
public final class HttpAttributes implements Map<String, Object> {
17

18
    public static final HttpAttributes EMPTY = new HttpAttributes();
1✔
19

20
    @Nonnull
21
    @Delegate
22
    private final Map<String, Object> map;
23

24
    public HttpAttributes() {
1✔
25
        map = Collections.emptyMap();
1✔
26
    }
1✔
27

28
    public HttpAttributes(final Map<String, Object> map) {
1✔
29
        this.map = Collections.unmodifiableMap(new HashMap<>(map));
1✔
30
    }
1✔
31

32
    @Override
33
    public boolean equals(Object o) {
34
        if (this == o) return true;
1✔
35
        if (!(o instanceof Map)) return false;
1✔
36
        return map.equals(o);
1✔
37
    }
38

39
    @Override
40
    public int hashCode() {
41
        return map.hashCode();
1✔
42
    }
43

44
    @Override
45
    public String toString() {
46
        return map.toString();
1✔
47
    }
48

49
    /**
50
     * Returns an immutable HttpAttributes, mapping only the specified key to the
51
     * specified value.
52
     *
53
     * @param key   the sole key to be stored in the returned HttpAttributes.
54
     * @param value the value to which the returned HttpAttributes maps {@code key}.
55
     * @return an immutable HttpAttributes containing only the specified key-value
56
     * mapping.
57
     */
58
    public static HttpAttributes of(String key, Object value) {
59
        Map<String, Object> m = Collections.singletonMap(key, value);
1✔
60
        return new HttpAttributes(m);
1✔
61
    }
62
}
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

© 2025 Coveralls, Inc