@Test public void testMigrateFromInitial() throws Exception { state.dataSources.add(new DataSource(DataSourceType.NEO4J_BOLT, "testName", Collections.emptyMap())); state.migrate(); List<? extends DataSourceApi> dataSources = state.containerV1.getDataSources(); assertThat(state.dataSources).hasSize(0); assertThat(dataSources).hasSize(1); DataSourceApi dataSource = dataSources.get(0); assertThat(dataSource.getUUID()) .isNotNull() .hasSameSizeAs(UUID.randomUUID().toString()); assertThat(dataSource.getName()) .isEqualTo("testName"); assertThat(dataSource.getDataSourceType()) .isEqualTo(DataSourceType.NEO4J_BOLT); }
public void migrate() { if (!migrated) { try { initialToV1(); } finally { migrated = true; } } }
DataSourcesComponentState { public void migrate() { if (!migrated) { try { initialToV1(); } finally { migrated = true; } } } }
DataSourcesComponentState { public void migrate() { if (!migrated) { try { initialToV1(); } finally { migrated = true; } } }  }
DataSourcesComponentState { public void migrate() { if (!migrated) { try { initialToV1(); } finally { migrated = true; } } }  DataSourceContainer getCurrentContainer(); void migrate(); }
DataSourcesComponentState { public void migrate() { if (!migrated) { try { initialToV1(); } finally { migrated = true; } } }  DataSourceContainer getCurrentContainer(); void migrate(); public List<DataSource> dataSources; public DataSourceContainerV1 containerV1; }