mirror of
https://github.com/apache/archiva.git
synced 2025-02-06 10:09:32 +00:00
Adding Referer Header to REST tests
This commit is contained in:
parent
367997a308
commit
65e04d66ce
@ -25,6 +25,7 @@
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
|
||||
import org.apache.archiva.redback.rest.services.AbstractRestServicesTest;
|
||||
import org.apache.cxf.jaxrs.client.WebClient;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
@ -84,6 +85,7 @@ public void runtimeInfoService()
|
||||
RuntimeInfoService.class,
|
||||
Collections.singletonList( new JacksonJaxbJsonProvider() ) );
|
||||
|
||||
WebClient.client(service).header("Referer","http://localhost");
|
||||
ApplicationRuntimeInfo applicationRuntimeInfo = service.getApplicationRuntimeInfo( "en" );
|
||||
|
||||
assertEquals( System.getProperty( "expectedVersion" ), applicationRuntimeInfo.getVersion() );
|
||||
|
@ -173,6 +173,8 @@ protected ProxyConnectorService getProxyConnectorService()
|
||||
Collections.singletonList( new JacksonJaxbJsonProvider() ) );
|
||||
|
||||
WebClient.client( service ).header( "Authorization", authorizationHeader );
|
||||
WebClient.client(service).header("Referer","http://localhost:"+port);
|
||||
|
||||
WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 300000L );
|
||||
return service;
|
||||
}
|
||||
@ -185,6 +187,8 @@ protected RemoteRepositoriesService getRemoteRepositoriesService()
|
||||
Collections.singletonList( new JacksonJaxbJsonProvider() ) );
|
||||
|
||||
WebClient.client( service ).header( "Authorization", authorizationHeader );
|
||||
WebClient.client(service).header("Referer","http://localhost:"+port);
|
||||
|
||||
WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 300000L );
|
||||
return service;
|
||||
}
|
||||
@ -197,6 +201,8 @@ protected ManagedRepositoriesService getManagedRepositoriesService()
|
||||
Collections.singletonList( new JacksonJaxbJsonProvider() ) );
|
||||
|
||||
WebClient.client( service ).header( "Authorization", authorizationHeader );
|
||||
WebClient.client(service).header("Referer","http://localhost:"+port);
|
||||
|
||||
WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 300000L );
|
||||
return service;
|
||||
}
|
||||
@ -210,6 +216,8 @@ protected RepositoryGroupService getRepositoryGroupService()
|
||||
Collections.singletonList( new JacksonJaxbJsonProvider() ) );
|
||||
|
||||
WebClient.client( service ).header( "Authorization", authorizationHeader );
|
||||
WebClient.client(service).header("Referer","http://localhost:"+port);
|
||||
|
||||
WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 300000L );
|
||||
return service;
|
||||
}
|
||||
@ -222,6 +230,8 @@ protected RepositoriesService getRepositoriesService()
|
||||
Collections.singletonList( new JacksonJaxbJsonProvider() ) );
|
||||
|
||||
WebClient.client( service ).header( "Authorization", authorizationHeader );
|
||||
WebClient.client(service).header("Referer","http://localhost:"+port);
|
||||
|
||||
WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 300000L );
|
||||
return service;
|
||||
}
|
||||
@ -234,6 +244,8 @@ protected SearchService getSearchService()
|
||||
Collections.singletonList( new JacksonJaxbJsonProvider() ) );
|
||||
|
||||
WebClient.client( service ).header( "Authorization", authorizationHeader );
|
||||
WebClient.client(service).header("Referer","http://localhost:"+port);
|
||||
|
||||
WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 300000L );
|
||||
return service;
|
||||
}
|
||||
@ -252,6 +264,8 @@ protected RoleManagementService getRoleManagementService( String authzHeader )
|
||||
RoleManagementService.class,
|
||||
Collections.singletonList( new JacksonJaxbJsonProvider() ) );
|
||||
|
||||
WebClient.client(service).header("Referer","http://localhost:"+port);
|
||||
|
||||
// for debuging purpose
|
||||
WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 3000000L );
|
||||
|
||||
@ -268,6 +282,8 @@ protected UserService getUserService( String authzHeader )
|
||||
JAXRSClientFactory.create( "http://localhost:" + port + "/" + getRestServicesPath() + "/redbackServices/",
|
||||
UserService.class, Collections.singletonList( new JacksonJaxbJsonProvider() ) );
|
||||
|
||||
WebClient.client(service).header("Referer","http://localhost:"+port);
|
||||
|
||||
// for debuging purpose
|
||||
WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 3000000L );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user