{
RemoteRepository remoteRepository = getRemoteRepositoriesService().getRemoteRepository( "central" );
remoteRepository.setUrl( "http://localhost:" + redirectPort );
getRemoteRepositoriesService().updateRemoteRepository( remoteRepository );
RoleManagementService roleManagementService = getRoleManagementService( authorizationHeader );
if ( !roleManagementService.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER,
"internal" ) )
{
roleManagementService.createTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, "internal" );
}
getUserService( authorizationHeader ).createGuestUser();
roleManagementService.assignRole( ArchivaRoleConstants.TEMPLATE_GUEST, "guest" );
roleManagementService.assignTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, "internal",
"guest" );
getUserService( authorizationHeader ).removeFromCache( "guest" );
File file = new File( "target/junit-4.9.jar" );