private void deleteLink(long id) { try { wsClient.projectLinks().delete(new DeleteWsRequest().setId(id)); } catch (Exception e) { // fail silently } }
private static void createUser(String login, String name) { adminWsClient .wsConnector() .call( new PostRequest("api/users/create") .setParam("login", login) .setParam("name", name) .setParam("password", "123456")); }
private CreateWsResponse createCustomLink() { return wsClient .projectLinks() .create( new CreateWsRequest() .setProjectKey("sample") .setName("Custom") .setUrl("http://example.org/custom")); }
@BeforeClass public static void analyzeProject() { orchestrator.resetData(); orchestrator .getServer() .restoreProfile(FileLocation.ofClasspath("/authorisation/one-issue-per-line-profile.xml")); orchestrator.getServer().provisionProject(PROJECT_KEY, "Sample"); orchestrator .getServer() .associateProjectToQualityProfile("sample", "xoo", "one-issue-per-line"); SonarScanner sampleProject = SonarScanner.create(projectDir("shared/xoo-sample")); orchestrator.executeBuild(sampleProject); adminWsClient = newAdminWsClient(orchestrator); permissionsWsClient = adminWsClient.permissions(); createUser(LOGIN, "George Orwell"); createGroup(GROUP_NAME); }
private static void deleteGroup(String groupName) { adminWsClient .wsConnector() .call(new PostRequest("api/user_groups/delete").setParam("name", groupName)); }
private static void deactivateUser(String login) { adminWsClient .wsConnector() .call(new PostRequest("api/users/deactivate").setParam("login", login)); }
private static SearchWsResponse searchIssues(SearchWsRequest request) { return adminClient.issues().search(request); }