Skip to content

Commit 357e426

Browse files
SK-2291: add constants in unit test cases
1 parent 4f7bd7e commit 357e426

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

v3/src/test/java/com/skyflow/vault/controller/VaultControllerTests.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import java.lang.reflect.Method;
2020
import java.util.ArrayList;
2121
import java.util.HashMap;
22-
import java.util.Scanner;
2322

2423
import static org.junit.Assert.*;
2524

@@ -249,7 +248,7 @@ public void testBatchSizeExceedsMax() throws Exception {
249248
// Ignore, Testing concurrency/batch config
250249
}
251250

252-
assertEquals(1000, getPrivateInt(controller, "insertBatchSize"));
251+
assertEquals(Constants.MAX_INSERT_BATCH_SIZE.intValue(), getPrivateInt(controller, "insertBatchSize"));
253252
}
254253

255254
@Test
@@ -265,7 +264,7 @@ public void testConcurrencyExceedsMax() throws Exception {
265264
// Ignore, Testing concurrency/batch config
266265
}
267266

268-
assertEquals(1, getPrivateInt(controller, "insertConcurrencyLimit"));
267+
assertEquals(Constants.INSERT_CONCURRENCY_LIMIT.intValue(), getPrivateInt(controller, "insertConcurrencyLimit"));
269268
}
270269

271270
@Test
@@ -280,7 +279,7 @@ public void testBatchSizeZeroOrNegative() throws Exception {
280279
// Ignore, Testing concurrency/batch config
281280
}
282281

283-
assertEquals(50, getPrivateInt(controller, "insertBatchSize"));
282+
assertEquals(Constants.INSERT_BATCH_SIZE.intValue(), getPrivateInt(controller, "insertBatchSize"));
284283

285284
writeEnv("INSERT_BATCH_SIZE=-5");
286285

@@ -290,7 +289,7 @@ public void testBatchSizeZeroOrNegative() throws Exception {
290289
// Ignore, Testing concurrency/batch config
291290
}
292291

293-
assertEquals(50, getPrivateInt(controller, "insertBatchSize"));
292+
assertEquals(Constants.INSERT_BATCH_SIZE.intValue(), getPrivateInt(controller, "insertBatchSize"));
294293
}
295294

296295
@Test
@@ -369,7 +368,7 @@ public void testHighConcurrencyForLowRecords() throws Exception {
369368

370369
// Only 10 batches needed, so concurrency should be clamped to 10
371370
assertEquals(1000, getPrivateInt(controller, "insertBatchSize"));
372-
assertEquals(10, getPrivateInt(controller, "insertConcurrencyLimit"));
371+
assertEquals(Constants.MAX_INSERT_CONCURRENCY_LIMIT.intValue(), getPrivateInt(controller, "insertConcurrencyLimit"));
373372
}
374373

375374

@@ -386,7 +385,7 @@ public void testFractionalLastBatch() throws Exception {
386385

387386
// Last batch should have 50 records, concurrency should be 101
388387
assertEquals(100, getPrivateInt(controller, "insertBatchSize"));
389-
assertEquals(10, getPrivateInt(controller, "insertConcurrencyLimit"));
388+
assertEquals(Constants.INSERT_CONCURRENCY_LIMIT.intValue(), getPrivateInt(controller, "insertConcurrencyLimit"));
390389
}
391390

392391
private int getPrivateInt(Object obj, String field) throws Exception {

v3/src/test/java/com/skyflow/vault/data/DetokenizeRequestTests.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
import com.skyflow.errors.ErrorCode;
44
import com.skyflow.errors.ErrorMessage;
55
import com.skyflow.errors.SkyflowException;
6-
import com.skyflow.utils.Constants;
7-
import com.skyflow.utils.Utils;
86
import com.skyflow.utils.validations.Validations;
97
import org.junit.Assert;
108
import org.junit.Test;

0 commit comments

Comments
 (0)