]> source.dussan.org Git - sonarqube.git/commitdiff
NO-JIRA removing duplicated method
authorLukasz Jarocki <lukasz.jarocki@sonarsource.com>
Tue, 10 Jan 2023 15:00:58 +0000 (16:00 +0100)
committersonartech <sonartech@sonarsource.com>
Wed, 11 Jan 2023 20:02:58 +0000 (20:02 +0000)
server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/ComponentUpdater.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/component/ComponentUpdaterTest.java

index b64b4ee70db02f47f3246d6dacc8db16fd8c1d31..3477be1c777b3034b7b5330729ed01ccbb2512fe 100644 (file)
@@ -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);
   }
index a2b789ca7f5015d7439922adb0a69f37db1fc388..9ad470537f78a2d15e9ea7f226c8b3f18376c41f 100644 (file)
@@ -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<BranchDto> branch = db.getDbClient().branchDao().selectByUuid(db.getSession(), app.branchUuid());
     assertThat(branch).isPresent();