private IDatasourceMgmtWebService datasourceMgmtWebService;
private DatabaseConnectionAdapter dbConnectionAdapter;
public void setUp() throws Exception {
IUnifiedRepository repository =
new MockUnifiedRepository( new MockUnifiedRepository.SpringSecurityCurrentUserProvider() );
datasourceMgmtService = new JcrBackedDatasourceMgmtService( repository, new DatabaseDialectService() );
datasourceMgmtWebService = new DefaultDatasourceMgmtWebService( datasourceMgmtService );
dbConnectionAdapter = new DatabaseConnectionAdapter();
SecurityContextHolder.getContext()
.setAuthentication(
new UsernamePasswordAuthenticationToken( MockUnifiedRepository.root().getName(), null,
new GrantedAuthority[0] ) );
repository.createFolder( repository.getFile( "/etc" ).getId(), new RepositoryFile.Builder( FOLDER_PDI ).folder(
true ).build(), new RepositoryFileAcl.Builder( MockUnifiedRepository.root() ).ace(
MockUnifiedRepository.everyone(), READ, WRITE ).build(), null );
repository.createFolder( repository.getFile( "/etc/pdi" ).getId(), new RepositoryFile.Builder( FOLDER_DATABASES )
.folder( true ).build(), null );
SecurityContextHolder.getContext().setAuthentication(
new UsernamePasswordAuthenticationToken( EXP_LOGIN, null, new GrantedAuthority[0] ) );
KettleClientEnvironment.init();