}
private void downloadAndVerify(Gav gav, String repoId)
throws IOException
{
Maven2ArtifactInfoResource data = downloadViewResource(gav, repoId);
Assert.assertEquals(data.getArtifactId(), gav.getArtifactId());
Assert.assertEquals(data.getGroupId(), gav.getGroupId());
if (gav.isSnapshot() && gav.getSnapshotTimeStamp() != null) {
// time stamp snapshot
String expectedVersion =
gav.getVersion().replaceFirst(
"SNAPSHOT",
new SimpleDateFormat("yyyyMMdd.HHmmss").format(new Date(gav.getSnapshotTimeStamp())) + "-"
+ gav.getSnapshotBuildNumber());
Assert.assertEquals(data.getVersion(), expectedVersion);
}
else {
// non snapshot
Assert.assertEquals(data.getVersion(), gav.getVersion());
}
Assert.assertEquals(data.getBaseVersion(), gav.getBaseVersion());
Assert.assertEquals(data.getClassifier(), gav.getClassifier());
Assert.assertEquals(data.getExtension(), gav.getExtension());
Assert.assertEquals(buildExpectedDepBlock(gav), data.getDependencyXmlChunk());
}