jdeppe-pivotal commented on code in PR #7558:
URL: https://github.com/apache/geode/pull/7558#discussion_r847328372


##########
geode-for-redis/src/test/java/org/apache/geode/redis/internal/data/delta/AddByteArraysDeltaUnitTest.java:
##########
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+
+package org.apache.geode.redis.internal.data.delta;
+
+import static 
org.apache.geode.redis.internal.data.delta.DeltaType.ADD_BYTE_ARRAYS;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import junitparams.Parameters;
+import junitparams.naming.TestCaseName;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import org.apache.geode.redis.internal.data.RedisData;
+import org.apache.geode.redis.internal.data.RedisList;
+import org.apache.geode.redis.internal.data.RedisSet;
+import org.apache.geode.redis.internal.data.RedisString;
+import org.apache.geode.test.junit.runners.GeodeParamsRunner;
+
+@RunWith(GeodeParamsRunner.class)
+public class AddByteArraysDeltaUnitTest extends AbstractRedisDeltaUnitTest {
+  @Test
+  public void testAddByteArraysDelta_forRedisList() throws Exception {
+    RedisList redisList = makeRedisList();
+    DataInputStream dis = getDataInputStream(redisList.getVersion() + 1);
+
+    redisList.fromDelta(dis);
+
+    assertThat(redisList.llen()).isEqualTo(5);
+    assertThat(redisList.lindex(0)).isEqualTo("firstNew".getBytes());
+    assertThat(redisList.lindex(1)).isEqualTo("secondNew".getBytes());
+    assertThat(redisList.lindex(2)).isEqualTo("zero".getBytes());

Review Comment:
   Please would you also assert that the version is correct here. For this 
delta type as well as:
   ```
   AddByteArraysTail
   AppendByteArray
   InsertByteArray
   RemoveElementsByIndex
   RetainElementsByIndexRange
   ```



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