use of com.ctrip.xpipe.redis.console.model.MigrationEventTbl in project x-pipe by ctripcorp.
the class MigrationServiceTest method createTest.
@Test
@DirtiesContext
public void createTest() throws ComponentLookupException {
long eventId = migrationService.createMigrationEvent(createEventDemo(1, 2));
MigrationEventTbl result = migrationService.find(eventId);
MigrationClusterTbl result_cluster = migrationService.findMigrationCluster(eventId, 1);
ClusterTbl cluster = clusterService.find(1);
List<MigrationShardTbl> result_shards = migrationService.findMigrationShards(result_cluster.getId());
Assert.assertEquals(eventId, result.getId());
Assert.assertEquals("unit test", result.getOperator());
Assert.assertNotNull(result_cluster);
Assert.assertEquals(1, result_cluster.getClusterId());
Assert.assertEquals(2, result_cluster.getDestinationDcId());
Assert.assertEquals(MigrationStatus.Initiated.toString(), result_cluster.getStatus());
Assert.assertEquals(ClusterStatus.Lock.toString(), cluster.getStatus());
Assert.assertEquals(2, result_shards.size());
}
Aggregations