@Test
void verifyAddressBookMigration() throws Exception {

    byte[] mediumAddressBookBytes = addressBook(5).toByteArray();
    int mediumIndex = mediumAddressBookBytes.length / 2;
    byte[] mediumAddressBookBytes1 = Arrays.copyOfRange(mediumAddressBookBytes, 0, mediumIndex);
    byte[] mediumAddressBookBytes2 = Arrays
            .copyOfRange(mediumAddressBookBytes, mediumIndex, mediumAddressBookBytes.length);
    byte[] largeAddressBookBytes = addressBook(10).toByteArray();
    int largeIndex = largeAddressBookBytes.length / 3;
    byte[] largeAddressBookBytes1 = Arrays.copyOfRange(largeAddressBookBytes, 0, largeIndex);
    byte[] largeAddressBookBytes2 = Arrays.copyOfRange(largeAddressBookBytes, largeIndex, largeIndex * 2);
    byte[] largeAddressBookBytes3 = Arrays
            .copyOfRange(largeAddressBookBytes, largeIndex * 2, largeAddressBookBytes.length);
    // inserts fileData
    List<FileData> fileDataList = new ArrayList<>();
    // 101 create w 3 nodes
    fileDataList.add(fileData(5L, 3, 101, TransactionTypeEnum.FILECREATE.getProtoId()));
    // 101 update -> append w 5 nodes
    fileDataList.add(fileData(10L, mediumAddressBookBytes1, 101, TransactionTypeEnum.FILEUPDATE.getProtoId()));
    fileDataList.add(fileData(15L, mediumAddressBookBytes2, 101, TransactionTypeEnum.FILEAPPEND.getProtoId()));
    // 102 update -> append w 5 nodes
    fileDataList.add(fileData(20L, mediumAddressBookBytes1, 102, TransactionTypeEnum.FILEUPDATE.getProtoId()));
    fileDataList.add(fileData(25L, mediumAddressBookBytes2, 102, TransactionTypeEnum.FILEAPPEND.getProtoId()));
    // 101 update -> append -> append w 10 nodes
    fileDataList.add(fileData(30L, largeAddressBookBytes1, 101, TransactionTypeEnum.FILEUPDATE.getProtoId()));
    fileDataList.add(fileData(35L, largeAddressBookBytes2, 101, TransactionTypeEnum.FILEAPPEND.getProtoId()));
    fileDataList.add(fileData(40L, largeAddressBookBytes3, 101, TransactionTypeEnum.FILEAPPEND.getProtoId()));
    // 102 update -> append -> append w 10 nodes
    fileDataList.add(fileData(45L, largeAddressBookBytes1, 102, TransactionTypeEnum.FILEUPDATE.getProtoId()));
    fileDataList.add(fileData(50L, largeAddressBookBytes2, 102, TransactionTypeEnum.FILEAPPEND.getProtoId()));
    fileDataList.add(fileData(51L, largeAddressBookBytes3, 102, TransactionTypeEnum.FILEAPPEND.getProtoId()));
    fileDataRepository.saveAll(fileDataList);
    // migration
    migration.migrate(new FlywayContext());
    assertEquals(11, fileDataRepository.count());
    assertEquals(6, addressBookRepository.count());
    assertEquals(37, addressBookEntryRepository.count());
}