@Override
    public void onEvent(ReplicaMigrationEvent event) {
        switch (event.getPartitionId()) {
            case MIGRATION_STARTED_PARTITION_ID:
                migrationListener.migrationStarted(event.getMigrationState());
                break;
            case MIGRATION_FINISHED_PARTITION_ID:
                migrationListener.migrationFinished(event.getMigrationState());
                break;
            default:
                if (event.isSuccess()) {
                    migrationListener.replicaMigrationCompleted(event);
                } else {
                    migrationListener.replicaMigrationFailed(event);
                }
        }
    }
@Test
    public void test_migrationProcessCompleted() {
        MigrationState migrationSchedule = new MigrationStateImpl();
        ReplicaMigrationEvent event = new ReplicaMigrationEventImpl(migrationSchedule, MIGRATION_FINISHED_PARTITION_ID, 0, null, null, true, 0L);
        adapter.onEvent(event);

        verify(listener, never()).migrationStarted(any(MigrationState.class));
        verify(listener).migrationFinished(migrationSchedule);
        verify(listener, never()).replicaMigrationCompleted(any(ReplicaMigrationEvent.class));
        verify(listener, never()).replicaMigrationFailed(any(ReplicaMigrationEvent.class));
    }