diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/AbstractArchivaRestTest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/AbstractArchivaRestTest.java index 2e61044df..82f496e9f 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/AbstractArchivaRestTest.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/AbstractArchivaRestTest.java @@ -42,8 +42,11 @@ import java.io.File; public abstract class AbstractArchivaRestTest extends AbstractRestServicesTest { + + // START SNIPPET: authz-header public String guestAuthzHeader = "Basic " + org.apache.cxf.common.util.Base64Utility.encode( ( "guest" + ":" ).getBytes() ); + // END SNIPPET: authz-header @Override protected String getSpringConfigLocation() @@ -149,6 +152,7 @@ public abstract class AbstractArchivaRestTest protected SearchService getSearchService( String authzHeader ) { + // START SNIPPET: cxf-searchservice-creation SearchService service = JAXRSClientFactory.create( "http://localhost:" + port + "/" + getRestServicesPath() + "/archivaServices/", SearchService.class ); @@ -159,6 +163,7 @@ public abstract class AbstractArchivaRestTest } WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 100000000 ); return service; + // END SNIPPET: cxf-searchservice-creation } diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/SearchServiceTest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/SearchServiceTest.java index 12a31bb44..0c331474e 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/SearchServiceTest.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/SearchServiceTest.java @@ -77,10 +77,13 @@ public class SearchServiceTest File targetRepo = createAndIndexRepo( testRepoId ); + // START SNIPPET: searchservice-artifact-versions SearchService searchService = getSearchService( authorizationHeader ); List artifacts = searchService.getArtifactVersions( "commons-logging", "commons-logging", "jar" ); + // END SNIPPET: searchservice-artifact-versions + assertNotNull( artifacts ); assertTrue( " not 3 results for commons-logging search but " + artifacts.size() + ":" + artifacts, artifacts.size() == 13 );