3 * Copyright (C) 2009-2017 SonarSource SA
4 * mailto:info AT sonarsource DOT com
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 3 of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 package org.sonar.server.computation.task.projectanalysis.step;
22 import java.text.SimpleDateFormat;
23 import java.util.Date;
24 import java.util.Random;
25 import java.util.stream.Stream;
26 import javax.annotation.Nullable;
27 import org.junit.Before;
28 import org.junit.Rule;
29 import org.junit.Test;
30 import org.sonar.api.resources.Qualifiers;
31 import org.sonar.api.resources.Scopes;
32 import org.sonar.api.utils.System2;
33 import org.sonar.db.DbClient;
34 import org.sonar.db.DbTester;
35 import org.sonar.db.component.ComponentDbTester;
36 import org.sonar.db.component.ComponentDto;
37 import org.sonar.db.component.ComponentTesting;
38 import org.sonar.db.organization.OrganizationDto;
39 import org.sonar.server.computation.task.projectanalysis.analysis.AnalysisMetadataHolderRule;
40 import org.sonar.server.computation.task.projectanalysis.component.BranchPersister;
41 import org.sonar.server.computation.task.projectanalysis.component.DefaultBranchImpl;
42 import org.sonar.server.computation.task.projectanalysis.component.MutableDbIdsRepositoryRule;
43 import org.sonar.server.computation.task.projectanalysis.component.MutableDisabledComponentsHolder;
44 import org.sonar.server.computation.task.projectanalysis.component.ProjectViewAttributes;
45 import org.sonar.server.computation.task.projectanalysis.component.SubViewAttributes;
46 import org.sonar.server.computation.task.projectanalysis.component.TreeRootHolderRule;
47 import org.sonar.server.computation.task.projectanalysis.component.ViewAttributes;
48 import org.sonar.server.computation.task.projectanalysis.component.ViewsComponent;
49 import org.sonar.server.computation.task.step.ComputationStep;
51 import static org.assertj.core.api.Assertions.assertThat;
52 import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
53 import static org.mockito.Mockito.mock;
54 import static org.mockito.Mockito.when;
55 import static org.sonar.db.component.ComponentTesting.newPrivateProjectDto;
56 import static org.sonar.db.component.ComponentTesting.newProjectCopy;
57 import static org.sonar.db.component.ComponentTesting.newSubView;
58 import static org.sonar.server.computation.task.projectanalysis.component.Component.Type.PROJECT_VIEW;
59 import static org.sonar.server.computation.task.projectanalysis.component.Component.Type.SUBVIEW;
60 import static org.sonar.server.computation.task.projectanalysis.component.Component.Type.VIEW;
61 import static org.sonar.server.computation.task.projectanalysis.component.ViewAttributes.Type.APPLICATION;
62 import static org.sonar.server.computation.task.projectanalysis.component.ViewAttributes.Type.PORTFOLIO;
63 import static org.sonar.server.computation.task.projectanalysis.component.ViewsComponent.builder;
65 public class ViewsPersistComponentsStepTest extends BaseStepTest {
67 private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd");
69 private static final String VIEW_KEY = "VIEW_KEY";
70 private static final String VIEW_NAME = "VIEW_NAME";
71 private static final String VIEW_DESCRIPTION = "view description";
72 private static final String VIEW_UUID = "VIEW_UUID";
73 private static final String SUBVIEW_1_KEY = "SUBVIEW_1_KEY";
74 private static final String SUBVIEW_1_NAME = "SUBVIEW_1_NAME";
75 private static final String SUBVIEW_1_DESCRIPTION = "subview 1 description";
76 private static final String SUBVIEW_1_UUID = "SUBVIEW_1_UUID";
77 private static final String PROJECT_VIEW_1_KEY = "PV1_KEY";
78 private static final String PROJECT_VIEW_1_NAME = "PV1_NAME";
79 private static final String PROJECT_VIEW_1_UUID = "PV1_UUID";
80 private static final String ORGANIZATION_UUID = "org1";
83 public DbTester dbTester = DbTester.create(System2.INSTANCE);
85 public TreeRootHolderRule treeRootHolder = new TreeRootHolderRule();
87 public MutableDbIdsRepositoryRule dbIdsRepository = MutableDbIdsRepositoryRule.create(treeRootHolder);
89 public AnalysisMetadataHolderRule analysisMetadataHolder = new AnalysisMetadataHolderRule()
90 .setOrganizationUuid(ORGANIZATION_UUID);
92 private System2 system2 = mock(System2.class);
93 private DbClient dbClient = dbTester.getDbClient();
95 private ComponentDbTester componentDbTester = new ComponentDbTester(dbTester);
96 private MutableDisabledComponentsHolder disabledComponentsHolder = mock(MutableDisabledComponentsHolder.class, RETURNS_DEEP_STUBS);
97 private PersistComponentsStep underTest;
98 private BranchPersister branchPersister;
101 public void setup() throws Exception {
102 now = DATE_FORMAT.parse("2015-06-02");
103 when(system2.now()).thenReturn(now.getTime());
105 dbTester.organizations().insertForUuid(ORGANIZATION_UUID);
106 analysisMetadataHolder.setBranch(new DefaultBranchImpl());
107 branchPersister = mock(BranchPersister.class);
108 underTest = new PersistComponentsStep(dbClient, treeRootHolder, dbIdsRepository, system2, disabledComponentsHolder, analysisMetadataHolder, branchPersister);
112 protected ComputationStep step() {
117 public void persist_empty_view() {
118 treeRootHolder.setRoot(createViewBuilder(PORTFOLIO).build());
122 assertRowsCountInTableProjects(1);
124 ComponentDto projectDto = getComponentFromDb(VIEW_KEY);
125 assertDtoIsView(projectDto);
129 public void persist_existing_empty_view() {
130 // most of the time view already exists since its supposed to be created when config is uploaded
131 persistComponents(newViewDto(dbTester.organizations().insert()));
133 treeRootHolder.setRoot(createViewBuilder(PORTFOLIO).build());
137 assertRowsCountInTableProjects(1);
139 assertDtoNotUpdated(VIEW_KEY);
143 public void persist_view_with_projectView() {
144 ComponentDto project = ComponentTesting.newPrivateProjectDto(dbTester.organizations().insert());
145 persistComponents(project);
147 treeRootHolder.setRoot(
148 createViewBuilder(PORTFOLIO)
149 .addChildren(createProjectView1Builder(project, null).build())
154 assertRowsCountInTableProjects(3);
156 ComponentDto viewDto = getComponentFromDb(VIEW_KEY);
157 assertDtoIsView(viewDto);
159 ComponentDto pv1Dto = getComponentFromDb(PROJECT_VIEW_1_KEY);
160 assertDtoIsProjectView1(pv1Dto, viewDto, viewDto, project);
164 public void persist_application_with_projectView() {
165 ComponentDto project = ComponentTesting.newPrivateProjectDto(dbTester.organizations().insert());
166 persistComponents(project);
168 treeRootHolder.setRoot(
169 createViewBuilder(APPLICATION)
170 .addChildren(createProjectView1Builder(project, null).build())
175 assertRowsCountInTableProjects(3);
177 ComponentDto applicationDto = getComponentFromDb(VIEW_KEY);
178 assertDtoIsApplication(applicationDto);
180 ComponentDto pv1Dto = getComponentFromDb(PROJECT_VIEW_1_KEY);
181 assertDtoIsProjectView1(pv1Dto, applicationDto, applicationDto, project);
185 public void persist_empty_subview() {
186 treeRootHolder.setRoot(
187 createViewBuilder(PORTFOLIO)
189 createSubView1Builder(null).build())
194 assertRowsCountInTableProjects(2);
196 ComponentDto viewDto = getComponentFromDb(VIEW_KEY);
197 assertDtoIsView(viewDto);
199 ComponentDto sv1Dto = getComponentFromDb(SUBVIEW_1_KEY);
200 assertDtoIsSubView1(viewDto, sv1Dto);
204 public void persist_empty_subview_having_original_view_uuid() {
205 treeRootHolder.setRoot(
206 createViewBuilder(PORTFOLIO)
208 createSubView1Builder("ORIGINAL_UUID").build())
213 assertRowsCountInTableProjects(2);
215 ComponentDto subView = getComponentFromDb(SUBVIEW_1_KEY);
216 assertThat(subView.getCopyResourceUuid()).isEqualTo("ORIGINAL_UUID");
220 public void persist_existing_empty_subview_under_existing_view() {
221 ComponentDto viewDto = newViewDto(dbTester.organizations().insert());
222 persistComponents(viewDto);
223 persistComponents(ComponentTesting.newSubView(viewDto, SUBVIEW_1_UUID, SUBVIEW_1_KEY).setName(SUBVIEW_1_NAME));
225 treeRootHolder.setRoot(
226 createViewBuilder(PORTFOLIO)
228 createSubView1Builder(null).build())
233 assertRowsCountInTableProjects(2);
235 assertDtoNotUpdated(VIEW_KEY);
236 assertDtoNotUpdated(SUBVIEW_1_KEY);
240 public void persist_empty_subview_under_existing_view() {
241 persistComponents(newViewDto(dbTester.organizations().insert()));
243 treeRootHolder.setRoot(
244 createViewBuilder(PORTFOLIO)
246 createSubView1Builder(null).build())
251 assertRowsCountInTableProjects(2);
253 assertDtoNotUpdated(VIEW_KEY);
254 assertDtoIsSubView1(getComponentFromDb(VIEW_KEY), getComponentFromDb(SUBVIEW_1_KEY));
258 public void persist_project_view_under_subview() {
259 ComponentDto project = ComponentTesting.newPrivateProjectDto(dbTester.organizations().insert());
260 persistComponents(project);
262 treeRootHolder.setRoot(
263 createViewBuilder(PORTFOLIO)
265 createSubView1Builder(null)
267 createProjectView1Builder(project, null).build())
273 assertRowsCountInTableProjects(4);
275 ComponentDto viewDto = getComponentFromDb(VIEW_KEY);
276 assertDtoIsView(viewDto);
277 ComponentDto subView1Dto = getComponentFromDb(SUBVIEW_1_KEY);
278 assertDtoIsSubView1(viewDto, subView1Dto);
279 ComponentDto pv1Dto = getComponentFromDb(PROJECT_VIEW_1_KEY);
280 assertDtoIsProjectView1(pv1Dto, viewDto, subView1Dto, project);
284 public void update_view_name_and_longName() {
285 ComponentDto viewDto = newViewDto(dbTester.organizations().insert()).setLongName("another long name").setCreatedAt(now);
286 persistComponents(viewDto);
288 treeRootHolder.setRoot(createViewBuilder(PORTFOLIO).build());
292 // commit functional transaction -> copies B-fields to A-fields
293 dbClient.componentDao().applyBChangesForRootComponentUuid(dbTester.getSession(), viewDto.uuid());
296 assertRowsCountInTableProjects(1);
297 ComponentDto newViewDto = getComponentFromDb(VIEW_KEY);
298 assertDtoIsView(newViewDto);
302 public void update_project_view() {
303 OrganizationDto organizationDto = dbTester.organizations().insert();
304 ComponentDto view = newViewDto(organizationDto);
305 ComponentDto project = ComponentTesting.newPrivateProjectDto(organizationDto);
306 persistComponents(view, project);
307 ComponentDto projectView = ComponentTesting.newProjectCopy(PROJECT_VIEW_1_UUID, project, view)
308 .setOrganizationUuid(ORGANIZATION_UUID)
309 .setDbKey(PROJECT_VIEW_1_KEY)
312 persistComponents(projectView);
314 treeRootHolder.setRoot(
315 createViewBuilder(PORTFOLIO)
316 .addChildren(createProjectView1Builder(project, null).build())
321 // commit functional transaction -> copies B-fields to A-fields
322 dbClient.componentDao().applyBChangesForRootComponentUuid(dbTester.getSession(), view.uuid());
325 assertRowsCountInTableProjects(3);
326 ComponentDto pv1Dto = getComponentFromDb(PROJECT_VIEW_1_KEY);
327 assertDtoIsProjectView1(pv1Dto, view, view, project);
331 public void update_copy_component_uuid_of_project_view() {
332 OrganizationDto organizationDto = dbTester.organizations().insert();
333 ComponentDto view = newViewDto(organizationDto);
334 ComponentDto project1 = newPrivateProjectDto(organizationDto, "P1");
335 ComponentDto project2 = newPrivateProjectDto(organizationDto, "P2");
336 persistComponents(view, project1, project2);
338 // Project view in DB is associated to project1
339 ComponentDto projectView = ComponentTesting.newProjectCopy(PROJECT_VIEW_1_UUID, project1, view)
340 .setDbKey(PROJECT_VIEW_1_KEY)
342 persistComponents(projectView);
344 treeRootHolder.setRoot(
345 createViewBuilder(PORTFOLIO)
346 // Project view in the View is linked to the first project2
347 .addChildren(createProjectView1Builder(project2, null).build())
352 // commit functional transaction -> copies B-fields to A-fields
353 dbClient.componentDao().applyBChangesForRootComponentUuid(dbTester.getSession(), view.uuid());
356 ComponentDto pv1Dto = getComponentFromDb(PROJECT_VIEW_1_KEY);
357 // Project view should now be linked to project2
358 assertDtoIsProjectView1(pv1Dto, view, view, project2);
362 public void update_copy_component_uuid_of_sub_view() {
363 OrganizationDto organizationDto = dbTester.organizations().insert();
364 ComponentDto view = newViewDto(organizationDto);
365 ComponentDto subView = newSubViewDto(view).setCopyComponentUuid("OLD_COPY");
366 persistComponents(view, subView);
368 treeRootHolder.setRoot(
369 createViewBuilder(PORTFOLIO)
371 createSubView1Builder("NEW_COPY").build())
376 // commit functional transaction -> copies B-fields to A-fields
377 dbClient.componentDao().applyBChangesForRootComponentUuid(dbTester.getSession(), view.uuid());
380 ComponentDto subViewReloaded = getComponentFromDb(SUBVIEW_1_KEY);
381 assertThat(subViewReloaded.getCopyResourceUuid()).isEqualTo("NEW_COPY");
385 public void persists_new_components_as_public_if_root_does_not_exist_yet_out_of_functional_transaction() {
386 ComponentDto project = dbTester.components().insertComponent(ComponentTesting.newPrivateProjectDto(dbTester.organizations().insert()));
387 treeRootHolder.setRoot(
388 createViewBuilder(PORTFOLIO)
390 createSubView1Builder(null)
392 createProjectView1Builder(project, null).build())
398 Stream.of(VIEW_UUID, SUBVIEW_1_UUID, PROJECT_VIEW_1_UUID)
399 .forEach(uuid -> assertThat(dbClient.componentDao().selectByUuid(dbTester.getSession(), uuid).get().isPrivate()).isFalse());
403 public void persists_new_components_with_visibility_of_root_in_db_out_of_functional_transaction() {
404 boolean isRootPrivate = new Random().nextBoolean();
405 ComponentDto project = dbTester.components().insertComponent(ComponentTesting.newPrivateProjectDto(dbTester.organizations().insert()));
406 OrganizationDto organization = dbTester.organizations().insert();
407 ComponentDto view = newViewDto(organization).setUuid(VIEW_UUID).setDbKey(VIEW_KEY).setName("View").setPrivate(isRootPrivate);
408 dbTester.components().insertComponent(view);
409 treeRootHolder.setRoot(
410 createViewBuilder(PORTFOLIO)
412 createSubView1Builder(null)
414 createProjectView1Builder(project, null).build())
420 Stream.of(VIEW_UUID, SUBVIEW_1_UUID, PROJECT_VIEW_1_UUID)
421 .forEach(uuid -> assertThat(dbClient.componentDao().selectByUuid(dbTester.getSession(), uuid).get().isPrivate())
422 .describedAs("for uuid " + uuid)
423 .isEqualTo(isRootPrivate));
427 public void persists_existing_components_with_visibility_of_root_in_db_out_of_functional_transaction() {
428 boolean isRootPrivate = new Random().nextBoolean();
429 ComponentDto project = dbTester.components().insertComponent(ComponentTesting.newPrivateProjectDto(dbTester.organizations().insert()));
430 OrganizationDto organization = dbTester.organizations().insert();
431 ComponentDto view = newViewDto(organization).setUuid(VIEW_UUID).setDbKey(VIEW_KEY).setName("View").setPrivate(isRootPrivate);
432 dbTester.components().insertComponent(view);
433 ComponentDto subView = newSubView(view).setUuid("BCDE").setDbKey("MODULE").setPrivate(!isRootPrivate);
434 dbTester.components().insertComponent(subView);
435 dbTester.components().insertComponent(newProjectCopy("DEFG", project, view).setDbKey("DIR").setPrivate(isRootPrivate));
436 treeRootHolder.setRoot(
437 createViewBuilder(PORTFOLIO)
439 createSubView1Builder(null)
441 createProjectView1Builder(project, null).build())
447 Stream.of(VIEW_UUID, SUBVIEW_1_UUID, PROJECT_VIEW_1_UUID, subView.uuid(), "DEFG")
448 .forEach(uuid -> assertThat(dbClient.componentDao().selectByUuid(dbTester.getSession(), uuid).get().isPrivate())
449 .describedAs("for uuid " + uuid)
450 .isEqualTo(isRootPrivate));
453 private static ViewsComponent.Builder createViewBuilder(ViewAttributes.Type viewType) {
454 return builder(VIEW, VIEW_KEY)
457 .setDescription(VIEW_DESCRIPTION)
458 .setViewAttributes(new ViewAttributes(viewType));
461 private ViewsComponent.Builder createSubView1Builder(@Nullable String originalViewUuid) {
462 return builder(SUBVIEW, SUBVIEW_1_KEY)
463 .setUuid(SUBVIEW_1_UUID)
464 .setName(SUBVIEW_1_NAME)
465 .setDescription(SUBVIEW_1_DESCRIPTION)
466 .setSubViewAttributes(new SubViewAttributes(originalViewUuid));
469 private static ViewsComponent.Builder createProjectView1Builder(ComponentDto project, Long analysisDate) {
470 return builder(PROJECT_VIEW, PROJECT_VIEW_1_KEY)
471 .setUuid(PROJECT_VIEW_1_UUID)
472 .setName(PROJECT_VIEW_1_NAME)
473 .setDescription("project view description is not persisted")
474 .setProjectViewAttributes(new ProjectViewAttributes(project.uuid(), analysisDate));
477 private void persistComponents(ComponentDto... componentDtos) {
478 componentDbTester.insertComponents(componentDtos);
481 private ComponentDto getComponentFromDb(String componentKey) {
482 return dbClient.componentDao().selectByKey(dbTester.getSession(), componentKey).get();
485 private void assertRowsCountInTableProjects(int rowCount) {
486 assertThat(dbTester.countRowsOfTable("projects")).isEqualTo(rowCount);
489 private void assertDtoNotUpdated(String componentKey) {
490 assertThat(getComponentFromDb(componentKey).getCreatedAt()).isNotEqualTo(now);
493 private ComponentDto newViewDto(OrganizationDto organizationDto) {
494 return ComponentTesting.newView(organizationDto, VIEW_UUID)
495 .setOrganizationUuid(ORGANIZATION_UUID)
500 private ComponentDto newSubViewDto(ComponentDto rootView) {
501 return ComponentTesting.newSubView(rootView, SUBVIEW_1_UUID, SUBVIEW_1_KEY)
502 .setName(SUBVIEW_1_NAME);
506 * Assertions to verify the DTO created from {@link #createViewBuilder(ViewAttributes.Type)} ()}
508 private void assertDtoIsView(ComponentDto dto) {
509 assertThat(dto.getOrganizationUuid()).isEqualTo(ORGANIZATION_UUID);
510 assertThat(dto.name()).isEqualTo(VIEW_NAME);
511 assertThat(dto.longName()).isEqualTo(VIEW_NAME);
512 assertThat(dto.description()).isEqualTo(VIEW_DESCRIPTION);
513 assertThat(dto.path()).isNull();
514 assertThat(dto.uuid()).isEqualTo(VIEW_UUID);
515 assertThat(dto.projectUuid()).isEqualTo(VIEW_UUID);
516 assertThat(dto.getRootUuid()).isEqualTo(VIEW_UUID);
517 assertThat(dto.moduleUuid()).isNull();
518 assertThat(dto.moduleUuidPath()).isEqualTo("." + dto.uuid() + ".");
519 assertThat(dto.qualifier()).isEqualTo(Qualifiers.VIEW);
520 assertThat(dto.scope()).isEqualTo(Scopes.PROJECT);
521 assertThat(dto.getCopyResourceUuid()).isNull();
522 assertThat(dto.getCreatedAt()).isEqualTo(now);
526 * Assertions to verify the DTO created from {@link #createViewBuilder(ViewAttributes.Type)} ()}
528 private void assertDtoIsApplication(ComponentDto dto) {
529 assertThat(dto.getOrganizationUuid()).isEqualTo(ORGANIZATION_UUID);
530 assertThat(dto.name()).isEqualTo(VIEW_NAME);
531 assertThat(dto.longName()).isEqualTo(VIEW_NAME);
532 assertThat(dto.description()).isEqualTo(VIEW_DESCRIPTION);
533 assertThat(dto.path()).isNull();
534 assertThat(dto.uuid()).isEqualTo(VIEW_UUID);
535 assertThat(dto.projectUuid()).isEqualTo(VIEW_UUID);
536 assertThat(dto.getRootUuid()).isEqualTo(VIEW_UUID);
537 assertThat(dto.moduleUuid()).isNull();
538 assertThat(dto.moduleUuidPath()).isEqualTo("." + dto.uuid() + ".");
539 assertThat(dto.qualifier()).isEqualTo(Qualifiers.APP);
540 assertThat(dto.scope()).isEqualTo(Scopes.PROJECT);
541 assertThat(dto.getCopyResourceUuid()).isNull();
542 assertThat(dto.getCreatedAt()).isEqualTo(now);
546 * Assertions to verify the DTO created from {@link #createProjectView1Builder(ComponentDto, Long)}
548 private void assertDtoIsSubView1(ComponentDto viewDto, ComponentDto sv1Dto) {
549 assertThat(sv1Dto.getOrganizationUuid()).isEqualTo(ORGANIZATION_UUID);
550 assertThat(sv1Dto.name()).isEqualTo(SUBVIEW_1_NAME);
551 assertThat(sv1Dto.longName()).isEqualTo(SUBVIEW_1_NAME);
552 assertThat(sv1Dto.description()).isEqualTo(SUBVIEW_1_DESCRIPTION);
553 assertThat(sv1Dto.path()).isNull();
554 assertThat(sv1Dto.uuid()).isEqualTo(SUBVIEW_1_UUID);
555 assertThat(sv1Dto.projectUuid()).isEqualTo(viewDto.uuid());
556 assertThat(sv1Dto.getRootUuid()).isEqualTo(viewDto.uuid());
557 assertThat(sv1Dto.moduleUuid()).isEqualTo(viewDto.uuid());
558 assertThat(sv1Dto.moduleUuidPath()).isEqualTo(viewDto.moduleUuidPath() + sv1Dto.uuid() + ".");
559 assertThat(sv1Dto.qualifier()).isEqualTo(Qualifiers.SUBVIEW);
560 assertThat(sv1Dto.scope()).isEqualTo(Scopes.PROJECT);
561 assertThat(sv1Dto.getCopyResourceUuid()).isNull();
562 assertThat(sv1Dto.getCreatedAt()).isEqualTo(now);
565 private void assertDtoIsProjectView1(ComponentDto pv1Dto, ComponentDto viewDto, ComponentDto parentViewDto, ComponentDto project) {
566 assertThat(pv1Dto.getOrganizationUuid()).isEqualTo(ORGANIZATION_UUID);
567 assertThat(pv1Dto.name()).isEqualTo(PROJECT_VIEW_1_NAME);
568 assertThat(pv1Dto.longName()).isEqualTo(PROJECT_VIEW_1_NAME);
569 assertThat(pv1Dto.description()).isNull();
570 assertThat(pv1Dto.path()).isNull();
571 assertThat(pv1Dto.uuid()).isEqualTo(PROJECT_VIEW_1_UUID);
572 assertThat(pv1Dto.projectUuid()).isEqualTo(viewDto.uuid());
573 assertThat(pv1Dto.getRootUuid()).isEqualTo(viewDto.uuid());
574 assertThat(pv1Dto.moduleUuid()).isEqualTo(parentViewDto.uuid());
575 assertThat(pv1Dto.moduleUuidPath()).isEqualTo(parentViewDto.moduleUuidPath() + pv1Dto.uuid() + ".");
576 assertThat(pv1Dto.qualifier()).isEqualTo(Qualifiers.PROJECT);
577 assertThat(pv1Dto.scope()).isEqualTo(Scopes.FILE);
578 assertThat(pv1Dto.getCopyResourceUuid()).isEqualTo(project.uuid());
579 assertThat(pv1Dto.getCreatedAt()).isEqualTo(now);