From: Teryk Bellahsene Date: Tue, 12 Sep 2017 14:28:08 +0000 (+0200) Subject: SONAR-9813 Add methods to create portfolio and application with visibility in Compone... X-Git-Tag: 6.6-RC1~280 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3fb59f2b5f1b9d5a04404ebc08c78df95a3377b0;p=sonarqube.git SONAR-9813 Add methods to create portfolio and application with visibility in ComponentDbTester --- diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/component/ComponentDbTester.java b/server/sonar-db-dao/src/test/java/org/sonar/db/component/ComponentDbTester.java index bda32e32bca..ddd63f27043 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/component/ComponentDbTester.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/component/ComponentDbTester.java @@ -114,45 +114,87 @@ public class ComponentDbTester { return insertComponentImpl(newPublicProjectDto(organizationDto, uuid), false, noExtraConfiguration()); } + /** + * @deprecated since 6.6 + * @see #insertPublicPortfolio(OrganizationDto, Consumer[]) + */ + @Deprecated public ComponentDto insertView() { return insertComponentImpl(newView(db.getDefaultOrganization()), false, noExtraConfiguration()); } + /** + * @deprecated since 6.6 + * @see #insertPublicPortfolio(OrganizationDto, Consumer[]) + */ public ComponentDto insertView(Consumer dtoPopulator) { return insertComponentImpl(newView(db.getDefaultOrganization()), false, dtoPopulator); } + /** + * @deprecated since 6.6 + * @see #insertPublicPortfolio(OrganizationDto, Consumer[]) + */ public ComponentDto insertView(OrganizationDto organizationDto) { return insertComponentImpl(newView(organizationDto), false, noExtraConfiguration()); } + /** + * @deprecated since 6.6 + * @see #insertPublicPortfolio(OrganizationDto, Consumer[]) + */ public ComponentDto insertView(OrganizationDto organizationDto, Consumer dtoPopulator) { return insertComponentImpl(newView(organizationDto), false, dtoPopulator); } + /** + * @deprecated since 6.6 + * @see #insertPublicPortfolio(OrganizationDto, Consumer[]) + */ public ComponentDto insertView(String uuid) { return insertComponentImpl(newView(db.getDefaultOrganization(), uuid), false, noExtraConfiguration()); } + /** + * @deprecated since 6.6 + * @see #insertPublicPortfolio(OrganizationDto, Consumer[]) + */ public ComponentDto insertView(OrganizationDto organizationDto, String uuid) { return insertComponentImpl(newView(organizationDto, uuid), false, noExtraConfiguration()); } - public ComponentDto insertApplication(OrganizationDto organizationDto) { - return insertComponentImpl(newApplication(organizationDto), false, noExtraConfiguration()); + @SafeVarargs + public final ComponentDto insertPublicPortfolio(OrganizationDto organization, Consumer... dtoPopulators) { + return insertComponentImpl(newView(organization).setPrivate(false), false, dtoPopulators); } - public ComponentDto insertApplication(OrganizationDto organizationDto, Consumer... dtoPopulators) { - return insertComponentImpl(newApplication(organizationDto), false, dtoPopulators); + @SafeVarargs + public final ComponentDto insertPrivatePortfolio(OrganizationDto organization, Consumer... dtoPopulators) { + return insertComponentImpl(newView(organization).setPrivate(true), true, dtoPopulators); + } + + @SafeVarargs + public final ComponentDto insertPublicApplication(OrganizationDto organization, Consumer... dtoPopulators) { + return insertComponentImpl(newApplication(organization).setPrivate(false), false, dtoPopulators); } - public ComponentDto insertSubView(ComponentDto view, Consumer dtoPopulator) { - return insertComponentImpl(newSubView(view), false, dtoPopulator); + @SafeVarargs + public final ComponentDto insertPrivateApplication(OrganizationDto organization, Consumer... dtoPopulators) { + return insertComponentImpl(newApplication(organization).setPrivate(true), true, dtoPopulators); + } + + /** + * @deprecated since 6.6 + * @see #insertPublicApplication(OrganizationDto, Consumer[]) + */ + @SafeVarargs + public final ComponentDto insertApplication(OrganizationDto organizationDto, Consumer... dtoPopulators) { + return insertComponentImpl(newApplication(organizationDto), false, dtoPopulators); } @SafeVarargs public final ComponentDto insertSubView(ComponentDto view, Consumer... dtoPopulators) { - return insertComponentImpl(newSubView(view), false, dtoPopulators); + return insertComponentImpl(newSubView(view), view.isPrivate(), dtoPopulators); } private static Consumer noExtraConfiguration() {