tledkov-gridgain commented on a change in pull request #9637:
URL: https://github.com/apache/ignite/pull/9637#discussion_r765679904



##########
File path: 
modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderAdditionalSelfTest.java
##########
@@ -1974,6 +1974,40 @@ public void testBuilderReusage() throws Exception {
         assertEquals("val2", builder.build().field("f1"));
     }
 
+    /**
+     * @throws Exception If fails
+     */
+    @Test
+    public void testGetFieldForNotAssignedValInEmptyBuilder() {
+        BinaryObjectBuilder builder = binaries().builder("SomeType")
+                .setField("w", "wewe");
+
+        String fieldValue = builder.getField("field");
+        String wValue = builder.getField("w");
+
+        assertNull(fieldValue);
+        assertEquals("wewe", wValue);
+    }
+
+    /**
+     * @throws Exception If fails
+     */
+    @Test
+    public void testGetFieldForNotAssignedValInBuilder() {
+        GridBinaryTestClasses.TestObjectContainer testObjectContainer = new 
GridBinaryTestClasses.TestObjectContainer();
+        testObjectContainer.foo = "binaryCachedValue";
+        BinaryObjectBuilderImpl builder = wrap(testObjectContainer);
+        builder.setField("w", "wewe");
+
+        String fieldValue = builder.getField("field");
+        String wValue = builder.getField("w");
+        String fooValue = builder.getField("foo");
+
+        assertNull(fieldValue);
+        assertEquals("wewe", wValue);
+        assertEquals("binaryCachedValue", fooValue);

Review comment:
       ```suggestion
           assertNull(builder.getField("field"));
           assertEquals("wewe", builder.getField("w"));
           assertEquals("binaryCachedValue", builder.getField("foo"));
   ```




-- 
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]


Reply via email to