ArtifactOutputStreamTest issue fixed
package org.carlspring.strongbox.io;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.security.NoSuchAlgorithmException;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import javax.inject.Inject;
+import javax.xml.bind.JAXBException;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.maven.artifact.Artifact;
import org.carlspring.maven.commons.util.ArtifactUtils;
import org.carlspring.strongbox.TestConfig;
import org.carlspring.strongbox.artifact.coordinates.ArtifactCoordinates;
@@ -8,29 +23,16 @@ import org.carlspring.strongbox.providers.io.RepositoryFileSystemProvider;
import org.carlspring.strongbox.providers.io.RepositoryPath;
import org.carlspring.strongbox.providers.layout.LayoutProvider;
import org.carlspring.strongbox.providers.layout.LayoutProviderRegistry;
+import org.carlspring.strongbox.services.ArtifactMetadataService;
import org.carlspring.strongbox.storage.Storage;
import org.carlspring.strongbox.storage.repository.Repository;
import org.carlspring.strongbox.testing.TestCaseWithMavenArtifactGenerationAndIndexing;
-
-import javax.inject.Inject;
-import javax.xml.bind.JAXBException;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.security.NoSuchAlgorithmException;
-import java.util.LinkedHashSet;
-import java.util.Set;
-
-import org.apache.commons.io.IOUtils;
-import org.apache.maven.artifact.Artifact;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
/**
* @author mtodorov
@@ -61,8 +63,7 @@ public class ArtifactOutputStreamTest
createRepository(STORAGE0, REPOSITORY_RELEASES, false);
generateArtifact(getRepositoryBasedir(STORAGE0, REPOSITORY_RELEASES).getAbsolutePath(),
- "org.carlspring.foo:temp-file-test:1.2.3:jar");
-
+ "org.carlspring.foo:temp-file-test:1.2.3");
}
@After
@@ -77,8 +78,8 @@ public class ArtifactOutputStreamTest
throws IOException,
NoSuchAlgorithmException
{
- final Storage storage = getConfiguration().getStorage("storage0");
- final Repository repository = storage.getRepository("releases");
+ final Storage storage = getConfiguration().getStorage(STORAGE0);
+ final Repository repository = storage.getRepository(REPOSITORY_RELEASES);
final Artifact artifact = ArtifactUtils.getArtifactFromGAVTC("org.carlspring.foo:temp-file-test:1.2.3:jar");
final ArtifactCoordinates coordinates = new MavenArtifactCoordinates(artifact);
@@ -107,8 +108,8 @@ public class ArtifactOutputStreamTest
throws IOException,
NoSuchAlgorithmException
{
- final Storage storage = getConfiguration().getStorage("storage0");
- final Repository repository = storage.getRepository("releases");
+ final Storage storage = getConfiguration().getStorage(STORAGE0);
+ final Repository repository = storage.getRepository(REPOSITORY_RELEASES);
final Artifact artifact = ArtifactUtils.getArtifactFromGAVTC("org.carlspring.foo:temp-file-test:1.2.4:jar");
final ArtifactCoordinates coordinates = new MavenArtifactCoordinates(artifact);
