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()
protected SearchService getSearchService( String authzHeader )
{
+ // START SNIPPET: cxf-searchservice-creation
SearchService service =
JAXRSClientFactory.create( "http://localhost:" + port + "/" + getRestServicesPath() + "/archivaServices/",
SearchService.class );
}
WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 100000000 );
return service;
+ // END SNIPPET: cxf-searchservice-creation
}
File targetRepo = createAndIndexRepo( testRepoId );
+ // START SNIPPET: searchservice-artifact-versions
SearchService searchService = getSearchService( authorizationHeader );
List<Artifact> 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 );