From d485a996378fcaf5b46d78da348c2b20793ed360 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Wed, 21 May 2014 14:30:32 +1000 Subject: [PATCH] [MRM-1843] provide mechanism to obtain the latest version of an artifact test for no content --- .../DownloadArtifactFromQueryTest.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadArtifactFromQueryTest.java b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadArtifactFromQueryTest.java index ce39b6846..c108af3e9 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadArtifactFromQueryTest.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadArtifactFromQueryTest.java @@ -174,6 +174,31 @@ public class DownloadArtifactFromQueryTest Assert.assertEquals( "http://localhost:" + port + "/repository/" + id + "/org/apache/archiva/archiva-test/2.0/archiva-test-2.0.jar", location ); + + + } + finally + { + getManagedRepositoriesService().deleteManagedRepository( id, false ); + } + + } + + @Test + public void download_no_content() + throws Exception + { + String id = createAndScanRepo(); + + try + { + Response response = + getSearchService().redirectToArtifactFile( null, "org.apache.archiva.beer", "archiva-wine", "LATEST", null, + null ); + + Assert.assertEquals( Response.Status.NO_CONTENT.getStatusCode(), response.getStatus() ); + + } finally {