From 2713bc03adf3266d04b256c98feaf4b6f5fa89ba Mon Sep 17 00:00:00 2001 From: Lukasz Jarocki Date: Tue, 10 Jan 2023 16:00:58 +0100 Subject: [PATCH] NO-JIRA removing duplicated method --- .../sonar/server/component/ComponentUpdater.java | 13 ------------- .../server/component/ComponentUpdaterTest.java | 6 +++--- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/ComponentUpdater.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/ComponentUpdater.java index b64b4ee70db..3477be1c777 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/ComponentUpdater.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/ComponentUpdater.java @@ -97,19 +97,6 @@ public class ComponentUpdater { return componentDto; } - /** - * - Create component - * - Apply default permission template - * - Add component to favorite if the component has the 'Project Creators' permission - * - Index component in es indexes - */ - public ComponentDto createApplicationOrPortfolio(DbSession dbSession, NewComponent newComponent, @Nullable String userUuid, - @Nullable String userLogin, @Nullable String mainBranchName) { - ComponentDto componentDto = createWithoutCommit(dbSession, newComponent, userUuid, userLogin, mainBranchName, c -> {}); - commitAndIndex(dbSession, componentDto); - return componentDto; - } - public void commitAndIndex(DbSession dbSession, ComponentDto componentDto) { projectIndexers.commitAndIndexComponents(dbSession, singletonList(componentDto), Cause.PROJECT_CREATION); } diff --git a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/component/ComponentUpdaterTest.java b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/component/ComponentUpdaterTest.java index a2b789ca7f5..9ad470537f7 100644 --- a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/component/ComponentUpdaterTest.java +++ b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/component/ComponentUpdaterTest.java @@ -337,10 +337,10 @@ public class ComponentUpdaterTest { } @Test - public void createApplicationOrPortfolio_createsComponentWithMasterBranchName() { + public void create_createsComponentWithMasterBranchName() { String componentNameAndKey = "createApplicationOrPortfolio"; - ComponentDto app = underTest.createApplicationOrPortfolio(db.getSession(), - NewComponent.newComponentBuilder().setName(componentNameAndKey).setKey(componentNameAndKey).setQualifier("APP").build(), null, null, null); + ComponentDto app = underTest.create(db.getSession(), NewComponent.newComponentBuilder().setName(componentNameAndKey) + .setKey(componentNameAndKey).setQualifier("APP").build(), null, null, null); Optional branch = db.getDbClient().branchDao().selectByUuid(db.getSession(), app.branchUuid()); assertThat(branch).isPresent(); -- 2.39.5