ArtifactManager { public JavaArchive artifact(String gav) throws IOException, ModuleLoadException { return artifact(gav, null); } ArtifactManager(WildFlySwarmDependenciesConf deps);  ArtifactManager(InputStream in);  ArtifactManager(); JavaArchive artifact(String gav); JavaArchive artifact(String gav, String asName); List<JavaArchive> allArtifacts();  }
@Test public void testArtifactGroupArtifact() throws Exception { assertThat(manager.artifact(String.format("%s:%s", ARTIFACT_GROUP_ID, ARTIFACT_ARTIFACT_ID)).getName()) .isEqualTo(ARTIFACT_NAME); }
@Test public void testArtifactGroupArtifactExplicitName() throws Exception { String name = "myname"; assertThat(manager.artifact(String.format("%s:%s", ARTIFACT_GROUP_ID, ARTIFACT_ARTIFACT_ID), name).getName()) .isEqualTo(name); }
@Test public void testArtifactGroupArtifactVersion() throws Exception { assertThat(manager.artifact(String.format("%s:%s:%s", ARTIFACT_GROUP_ID, ARTIFACT_ARTIFACT_ID, ARTIFACT_VERSION)).getName()) .isEqualTo(ARTIFACT_NAME); }
@Test public void testArtifactGroupArtifactPackagingVersion() throws Exception { assertThat(manager.artifact(String.format("%s:%s:%s:%s", ARTIFACT_GROUP_ID, ARTIFACT_ARTIFACT_ID, ARTIFACT_PACKAGING, ARTIFACT_VERSION)) .getName()).isEqualTo(ARTIFACT_NAME); }
@Test public void testArtifactInvalidGroupArtifact() throws Exception { try { manager.artifact(String.format("%s:%s", ARTIFACT_INVALID_GROUP_ID, ARTIFACT_INVALID_ARTIFACT_ID)); fail("RuntimeException should have been thrown"); } catch (RuntimeException e) { assertThat(e.getMessage()).contains("Unable to determine version number from GAV"); } }
@Test public void testArtifactInvalidGroupArtifactVersion() throws Exception { try { manager.artifact(String.format("%s:%s:%s", ARTIFACT_INVALID_GROUP_ID, ARTIFACT_INVALID_ARTIFACT_ID, ARTIFACT_INVALID_VERSION)); fail("RuntimeException should have been thrown"); } catch (RuntimeException e) { assertThat(e).hasMessage("Artifact not found."); } }
@Test public void testArtifactInvalidGroupArtifactPackagingVersion() throws Exception { try { manager.artifact(String.format("%s:%s:%s:%s", ARTIFACT_INVALID_GROUP_ID, ARTIFACT_INVALID_ARTIFACT_ID, ARTIFACT_INVALID_PACKAGING, ARTIFACT_INVALID_VERSION)); fail("RuntimeException should have been thrown"); } catch (RuntimeException e) { assertThat(e).hasMessage("Artifact not found."); } }