nastra commented on code in PR #7895:
URL: https://github.com/apache/iceberg/pull/7895#discussion_r1241797499
##########
core/src/test/java/org/apache/iceberg/util/TestStructLikeMap.java:
##########
@@ -43,28 +43,29 @@ public void testSingleRecord() {
Record record1 = gRecord.copy(ImmutableMap.of("id", 1, "data", "aaa"));
Map<StructLike, String> map = StructLikeMap.create(STRUCT_TYPE);
- Assert.assertEquals(0, map.size());
+ assertThat(map).isEmpty();
map.put(record1, "1-aaa");
- Assert.assertEquals(1, map.size());
- Assert.assertFalse(map.isEmpty());
- Assert.assertTrue(map.containsKey(record1));
- Assert.assertTrue(map.containsValue("1-aaa"));
- Assert.assertEquals("1-aaa", map.get(record1));
+ assertThat(map.size()).isOne();
+ assertThat(map)
+ .isNotEmpty()
+ .containsKey(record1)
+ .containsValue("1-aaa")
+ .containsEntry(record1, "1-aaa");
Set<StructLike> keySet = map.keySet();
- Assert.assertEquals(1, keySet.size());
- Assert.assertTrue(keySet.contains(record1));
+ assertThat(keySet.size()).isOne();
+ assertThat(keySet).contains(record1);
Collection<String> values = map.values();
- Assert.assertEquals(1, values.size());
- Assert.assertEquals("1-aaa", values.toArray(new String[0])[0]);
+ assertThat(values.size()).isOne();
+ assertThat(values.toArray(new String[0])[0]).isEqualTo("1-aaa");
Set<Map.Entry<StructLike, String>> entrySet = map.entrySet();
- Assert.assertEquals(1, entrySet.size());
+ assertThat(entrySet.size()).isOne();
Review Comment:
hasSize
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]