Assert.assertEquals("1.1", extensionPage.getMetaDataValue("version"));
Assert.assertTrue(extensionPage.isValidExtension());
// 2.0
TestExtension emptyExtension =
getRepositoryTestUtils().getTestExtension(new ExtensionId("emptyjar", "1.0"), "jar");
long fileSize = FileUtils.sizeOf(emptyExtension.getFile().getFile());
ExtensionVersion extension =
getUtil().getRESTResource(Resources.EXTENSION_VERSION, null, "maven:extension", "2.0");
Assert.assertEquals("maven:extension", extension.getId());
Assert.assertEquals("jar", extension.getType());
Assert.assertEquals("2.0", extension.getVersion());
Assert.assertEquals("name", extension.getName());
Assert.assertEquals("summary2", extension.getSummary());
Assert.assertEquals("summary2\n some more details", extension.getDescription());
Assert.assertEquals("Administrator", extension.getAuthors().get(0).getName());
Assert.assertEquals(this.baseAuthor.getURL().toString(), extension.getAuthors().get(0).getUrl());
Assert.assertEquals(Arrays.asList("maven:oldextension"), extension.getFeatures());
Assert.assertEquals("GNU Lesser General Public License 2.1", extension.getLicenses().get(0).getName());
Assert.assertEquals(fileSize,
getUtil().getRESTBuffer(Resources.EXTENSION_VERSION_FILE, null, "maven:extension", "2.0").length);
// 1.0
extension = getUtil().getRESTResource(Resources.EXTENSION_VERSION, null, "maven:extension", "1.0");
Assert.assertEquals("maven:extension", extension.getId());
Assert.assertEquals("jar", extension.getType());
Assert.assertEquals("1.0", extension.getVersion());
Assert.assertEquals("name", extension.getName());
Assert.assertEquals("summary2", extension.getSummary());
Assert.assertEquals("summary2\n some more details", extension.getDescription());
Assert.assertEquals("Administrator", extension.getAuthors().get(0).getName());
Assert.assertEquals(this.baseAuthor.getURL().toString(), extension.getAuthors().get(0).getUrl());
Assert.assertEquals(Arrays.asList("maven:oldextension"), extension.getFeatures());
Assert.assertEquals("GNU Lesser General Public License 2.1", extension.getLicenses().get(0).getName());
Assert.assertEquals(FileUtils.sizeOf(emptyExtension.getFile().getFile()),
getUtil().getRESTBuffer(Resources.EXTENSION_VERSION_FILE, null, "maven:extension", "1.0").length);
// 0.9
extension = getUtil().getRESTResource(Resources.EXTENSION_VERSION, null, "maven:extension", "0.9");