MCPcopy Index your code
hub / github.com/OpenFeign/feign / emptyValueOf

Method emptyValueOf

core/src/test/java/feign/UtilTest.java:55–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

53 }
54
55 @Test
56 void emptyValueOf() throws Exception {
57 assertThat(Util.emptyValueOf(boolean.class)).isEqualTo(false);
58 assertThat(Util.emptyValueOf(Boolean.class)).isEqualTo(false);
59 assertThat((byte[]) Util.emptyValueOf(byte[].class)).isEmpty();
60 assertThat(Util.emptyValueOf(Collection.class)).isEqualTo(Collections.emptyList());
61 assertThat(((Iterator<?>) Util.emptyValueOf(Iterator.class)).hasNext()).isFalse();
62 assertThat(Util.emptyValueOf(List.class)).isEqualTo(Collections.emptyList());
63 assertThat(Util.emptyValueOf(Map.class)).isEqualTo(Collections.emptyMap());
64 assertThat(Util.emptyValueOf(Set.class)).isEqualTo(Collections.emptySet());
65 assertThat(Util.emptyValueOf(Optional.class)).isEqualTo(Optional.empty());
66 }
67
68 /** In other words, {@code List<String>} is as empty as {@code List<?>}. */
69 @Test

Callers

nothing calls this directly

Calls 5

emptyValueOfMethod · 0.95
isEmptyMethod · 0.80
emptyMethod · 0.65
assertThatMethod · 0.45
hasNextMethod · 0.45

Tested by

no test coverage detected