-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d0f71a3
commit 78f56a0
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,6 +81,32 @@ void testDelete() { | |
assertTrue(selected.isEmpty(), "Expected no records after deletion."); | ||
} | ||
|
||
@Test | ||
void testBulkInsert() { | ||
// Prepare test data | ||
List<MemberRecord> members = | ||
List.of( | ||
createMemberRecord("Test1", "[email protected]", "1234567890", "Address 1", (byte) 100), | ||
createMemberRecord( | ||
"Test2", "[email protected]", "0987654321", "Address 2", (byte) 100)); | ||
|
||
// Execute bulkInsert | ||
repository.bulkInsert(members); | ||
|
||
// Verify inserted data | ||
List<MemberRecord> selected = | ||
repository.selectByTypeAndDeleteFlag(List.of((byte) 100), (byte) 0); | ||
assertEquals(2, selected.size(), "Expected 2 records to be inserted."); | ||
|
||
assertEquals("Test1", selected.get(0).getName(), "First record name mismatch."); | ||
assertEquals("Test2", selected.get(1).getName(), "Second record name mismatch."); | ||
assertEquals("[email protected]", selected.get(0).getEmail(), "First record email mismatch."); | ||
assertEquals("[email protected]", selected.get(1).getEmail(), "Second record email mismatch."); | ||
|
||
// Clean up inserted records | ||
selected.forEach(record -> repository.delete(record.getId())); | ||
} | ||
|
||
private void cleanupRecordsByType(byte type) { | ||
List<MemberRecord> existingRecords = | ||
repository.selectByTypeAndDeleteFlag(List.of(type), (byte) 0); | ||
|