use of org.commonjava.indy.subsys.datafile.DataFile in project indy by Commonjava.
the class LegacyDataMigrationActionTest method dataFileMigrationForExistingHostedRepoJSON.
@Test
public void dataFileMigrationForExistingHostedRepoJSON() throws Exception {
final DataFile dir = dfm.getDataFile(INDY_STORE, hosted.singularEndpointName());
dir.mkdirs();
final DataFile old = dfm.getDataFile(INDY_STORE, hosted.singularEndpointName(), "test.json");
final DataFile migrated = dfm.getDataFile(INDY_STORE, MAVEN_PKG_KEY, hosted.singularEndpointName(), "test.json");
String srcJson = "{\"name\": \"test\", \"type\" : \"hosted\", \"packageType\": \"maven\", \"key\": \"maven:hosted:test\"}";
old.writeString(srcJson, new ChangeSummary(ChangeSummary.SYSTEM_USER, "test repo creation"));
migrated.writeString(srcJson, new ChangeSummary(ChangeSummary.SYSTEM_USER, "test repo creation"));
final boolean result = action.migrate();
assertThat(result, equalTo(false));
}
Aggregations