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.BranchPersisterDelegate;
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 BranchPersisterDelegate 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(null));
107 underTest = new PersistComponentsStep(dbClient, treeRootHolder, dbIdsRepository, system2, disabledComponentsHolder, analysisMetadataHolder, branchPersister);
111 protected ComputationStep step() {
116 public void persist_empty_view() {
117 treeRootHolder.setRoot(createViewBuilder(PORTFOLIO).build());
121 assertRowsCountInTableProjects(1);
123 ComponentDto projectDto = getComponentFromDb(VIEW_KEY);
124 assertDtoIsView(projectDto);
128 public void persist_existing_empty_view() {
129 // most of the time view already exists since its supposed to be created when config is uploaded
130 persistComponents(newViewDto(dbTester.organizations().insert()));
132 treeRootHolder.setRoot(createViewBuilder(PORTFOLIO).build());
136 assertRowsCountInTableProjects(1);
138 assertDtoNotUpdated(VIEW_KEY);
142 public void persist_view_with_projectView() {
143 ComponentDto project = ComponentTesting.newPrivateProjectDto(dbTester.organizations().insert());
144 persistComponents(project);
146 treeRootHolder.setRoot(
147 createViewBuilder(PORTFOLIO)
148 .addChildren(createProjectView1Builder(project, null).build())
153 assertRowsCountInTableProjects(3);
155 ComponentDto viewDto = getComponentFromDb(VIEW_KEY);
156 assertDtoIsView(viewDto);
158 ComponentDto pv1Dto = getComponentFromDb(PROJECT_VIEW_1_KEY);
159 assertDtoIsProjectView1(pv1Dto, viewDto, viewDto, project);
163 public void persist_application_with_projectView() {
164 ComponentDto project = ComponentTesting.newPrivateProjectDto(dbTester.organizations().insert());
165 persistComponents(project);
167 treeRootHolder.setRoot(
168 createViewBuilder(APPLICATION)
169 .addChildren(createProjectView1Builder(project, null).build())
174 assertRowsCountInTableProjects(3);
176 ComponentDto applicationDto = getComponentFromDb(VIEW_KEY);
177 assertDtoIsApplication(applicationDto);
179 ComponentDto pv1Dto = getComponentFromDb(PROJECT_VIEW_1_KEY);
180 assertDtoIsProjectView1(pv1Dto, applicationDto, applicationDto, project);
184 public void persist_empty_subview() {
185 treeRootHolder.setRoot(
186 createViewBuilder(PORTFOLIO)
188 createSubView1Builder(null).build())
193 assertRowsCountInTableProjects(2);
195 ComponentDto viewDto = getComponentFromDb(VIEW_KEY);
196 assertDtoIsView(viewDto);
198 ComponentDto sv1Dto = getComponentFromDb(SUBVIEW_1_KEY);
199 assertDtoIsSubView1(viewDto, sv1Dto);
203 public void persist_empty_subview_having_original_view_uuid() {
204 treeRootHolder.setRoot(
205 createViewBuilder(PORTFOLIO)
207 createSubView1Builder("ORIGINAL_UUID").build())
212 assertRowsCountInTableProjects(2);
214 ComponentDto subView = getComponentFromDb(SUBVIEW_1_KEY);
215 assertThat(subView.getCopyResourceUuid()).isEqualTo("ORIGINAL_UUID");
219 public void persist_existing_empty_subview_under_existing_view() {
220 ComponentDto viewDto = newViewDto(dbTester.organizations().insert());
221 persistComponents(viewDto);
222 persistComponents(ComponentTesting.newSubView(viewDto, SUBVIEW_1_UUID, SUBVIEW_1_KEY).setName(SUBVIEW_1_NAME));
224 treeRootHolder.setRoot(
225 createViewBuilder(PORTFOLIO)
227 createSubView1Builder(null).build())
232 assertRowsCountInTableProjects(2);
234 assertDtoNotUpdated(VIEW_KEY);
235 assertDtoNotUpdated(SUBVIEW_1_KEY);
239 public void persist_empty_subview_under_existing_view() {
240 persistComponents(newViewDto(dbTester.organizations().insert()));
242 treeRootHolder.setRoot(
243 createViewBuilder(PORTFOLIO)
245 createSubView1Builder(null).build())
250 assertRowsCountInTableProjects(2);
252 assertDtoNotUpdated(VIEW_KEY);
253 assertDtoIsSubView1(getComponentFromDb(VIEW_KEY), getComponentFromDb(SUBVIEW_1_KEY));
257 public void persist_project_view_under_subview() {
258 ComponentDto project = ComponentTesting.newPrivateProjectDto(dbTester.organizations().insert());
259 persistComponents(project);
261 treeRootHolder.setRoot(
262 createViewBuilder(PORTFOLIO)
264 createSubView1Builder(null)
266 createProjectView1Builder(project, null).build())
272 assertRowsCountInTableProjects(4);
274 ComponentDto viewDto = getComponentFromDb(VIEW_KEY);
275 assertDtoIsView(viewDto);
276 ComponentDto subView1Dto = getComponentFromDb(SUBVIEW_1_KEY);
277 assertDtoIsSubView1(viewDto, subView1Dto);
278 ComponentDto pv1Dto = getComponentFromDb(PROJECT_VIEW_1_KEY);
279 assertDtoIsProjectView1(pv1Dto, viewDto, subView1Dto, project);
283 public void update_view_name_and_longName() {
284 ComponentDto viewDto = newViewDto(dbTester.organizations().insert()).setLongName("another long name").setCreatedAt(now);
285 persistComponents(viewDto);
287 treeRootHolder.setRoot(createViewBuilder(PORTFOLIO).build());
291 // commit functional transaction -> copies B-fields to A-fields
292 dbClient.componentDao().applyBChangesForRootComponentUuid(dbTester.getSession(), viewDto.uuid());
295 assertRowsCountInTableProjects(1);
296 ComponentDto newViewDto = getComponentFromDb(VIEW_KEY);
297 assertDtoIsView(newViewDto);
301 public void update_project_view() {
302 OrganizationDto organizationDto = dbTester.organizations().insert();
303 ComponentDto view = newViewDto(organizationDto);
304 ComponentDto project = ComponentTesting.newPrivateProjectDto(organizationDto);
305 persistComponents(view, project);
306 ComponentDto projectView = ComponentTesting.newProjectCopy(PROJECT_VIEW_1_UUID, project, view)
307 .setOrganizationUuid(ORGANIZATION_UUID)
308 .setDbKey(PROJECT_VIEW_1_KEY)
311 persistComponents(projectView);
313 treeRootHolder.setRoot(
314 createViewBuilder(PORTFOLIO)
315 .addChildren(createProjectView1Builder(project, null).build())
320 // commit functional transaction -> copies B-fields to A-fields
321 dbClient.componentDao().applyBChangesForRootComponentUuid(dbTester.getSession(), view.uuid());
324 assertRowsCountInTableProjects(3);
325 ComponentDto pv1Dto = getComponentFromDb(PROJECT_VIEW_1_KEY);
326 assertDtoIsProjectView1(pv1Dto, view, view, project);
330 public void update_copy_component_uuid_of_project_view() {
331 OrganizationDto organizationDto = dbTester.organizations().insert();
332 ComponentDto view = newViewDto(organizationDto);
333 ComponentDto project1 = newPrivateProjectDto(organizationDto, "P1");
334 ComponentDto project2 = newPrivateProjectDto(organizationDto, "P2");
335 persistComponents(view, project1, project2);
337 // Project view in DB is associated to project1
338 ComponentDto projectView = ComponentTesting.newProjectCopy(PROJECT_VIEW_1_UUID, project1, view)
339 .setDbKey(PROJECT_VIEW_1_KEY)
341 persistComponents(projectView);
343 treeRootHolder.setRoot(
344 createViewBuilder(PORTFOLIO)
345 // Project view in the View is linked to the first project2
346 .addChildren(createProjectView1Builder(project2, null).build())
351 // commit functional transaction -> copies B-fields to A-fields
352 dbClient.componentDao().applyBChangesForRootComponentUuid(dbTester.getSession(), view.uuid());
355 ComponentDto pv1Dto = getComponentFromDb(PROJECT_VIEW_1_KEY);
356 // Project view should now be linked to project2
357 assertDtoIsProjectView1(pv1Dto, view, view, project2);
361 public void update_copy_component_uuid_of_sub_view() {
362 OrganizationDto organizationDto = dbTester.organizations().insert();
363 ComponentDto view = newViewDto(organizationDto);
364 ComponentDto subView = newSubViewDto(view).setCopyComponentUuid("OLD_COPY");
365 persistComponents(view, subView);
367 treeRootHolder.setRoot(
368 createViewBuilder(PORTFOLIO)
370 createSubView1Builder("NEW_COPY").build())
375 // commit functional transaction -> copies B-fields to A-fields
376 dbClient.componentDao().applyBChangesForRootComponentUuid(dbTester.getSession(), view.uuid());
379 ComponentDto subViewReloaded = getComponentFromDb(SUBVIEW_1_KEY);
380 assertThat(subViewReloaded.getCopyResourceUuid()).isEqualTo("NEW_COPY");
384 public void persists_new_components_as_public_if_root_does_not_exist_yet_out_of_functional_transaction() {
385 ComponentDto project = dbTester.components().insertComponent(ComponentTesting.newPrivateProjectDto(dbTester.organizations().insert()));
386 treeRootHolder.setRoot(
387 createViewBuilder(PORTFOLIO)
389 createSubView1Builder(null)
391 createProjectView1Builder(project, null).build())
397 Stream.of(VIEW_UUID, SUBVIEW_1_UUID, PROJECT_VIEW_1_UUID)
398 .forEach(uuid -> assertThat(dbClient.componentDao().selectByUuid(dbTester.getSession(), uuid).get().isPrivate()).isFalse());
402 public void persists_new_components_with_visibility_of_root_in_db_out_of_functional_transaction() {
403 boolean isRootPrivate = new Random().nextBoolean();
404 ComponentDto project = dbTester.components().insertComponent(ComponentTesting.newPrivateProjectDto(dbTester.organizations().insert()));
405 OrganizationDto organization = dbTester.organizations().insert();
406 ComponentDto view = newViewDto(organization).setUuid(VIEW_UUID).setDbKey(VIEW_KEY).setName("View").setPrivate(isRootPrivate);
407 dbTester.components().insertComponent(view);
408 treeRootHolder.setRoot(
409 createViewBuilder(PORTFOLIO)
411 createSubView1Builder(null)
413 createProjectView1Builder(project, null).build())
419 Stream.of(VIEW_UUID, SUBVIEW_1_UUID, PROJECT_VIEW_1_UUID)
420 .forEach(uuid -> assertThat(dbClient.componentDao().selectByUuid(dbTester.getSession(), uuid).get().isPrivate())
421 .describedAs("for uuid " + uuid)
422 .isEqualTo(isRootPrivate));
426 public void persists_existing_components_with_visibility_of_root_in_db_out_of_functional_transaction() {
427 boolean isRootPrivate = new Random().nextBoolean();
428 ComponentDto project = dbTester.components().insertComponent(ComponentTesting.newPrivateProjectDto(dbTester.organizations().insert()));
429 OrganizationDto organization = dbTester.organizations().insert();
430 ComponentDto view = newViewDto(organization).setUuid(VIEW_UUID).setDbKey(VIEW_KEY).setName("View").setPrivate(isRootPrivate);
431 dbTester.components().insertComponent(view);
432 ComponentDto subView = newSubView(view).setUuid("BCDE").setDbKey("MODULE").setPrivate(!isRootPrivate);
433 dbTester.components().insertComponent(subView);
434 dbTester.components().insertComponent(newProjectCopy("DEFG", project, view).setDbKey("DIR").setPrivate(isRootPrivate));
435 treeRootHolder.setRoot(
436 createViewBuilder(PORTFOLIO)
438 createSubView1Builder(null)
440 createProjectView1Builder(project, null).build())
446 Stream.of(VIEW_UUID, SUBVIEW_1_UUID, PROJECT_VIEW_1_UUID, subView.uuid(), "DEFG")
447 .forEach(uuid -> assertThat(dbClient.componentDao().selectByUuid(dbTester.getSession(), uuid).get().isPrivate())
448 .describedAs("for uuid " + uuid)
449 .isEqualTo(isRootPrivate));
452 private static ViewsComponent.Builder createViewBuilder(ViewAttributes.Type viewType) {
453 return builder(VIEW, VIEW_KEY)
456 .setDescription(VIEW_DESCRIPTION)
457 .setViewAttributes(new ViewAttributes(viewType));
460 private ViewsComponent.Builder createSubView1Builder(@Nullable String originalViewUuid) {
461 return builder(SUBVIEW, SUBVIEW_1_KEY)
462 .setUuid(SUBVIEW_1_UUID)
463 .setName(SUBVIEW_1_NAME)
464 .setDescription(SUBVIEW_1_DESCRIPTION)
465 .setSubViewAttributes(new SubViewAttributes(originalViewUuid));
468 private static ViewsComponent.Builder createProjectView1Builder(ComponentDto project, Long analysisDate) {
469 return builder(PROJECT_VIEW, PROJECT_VIEW_1_KEY)
470 .setUuid(PROJECT_VIEW_1_UUID)
471 .setName(PROJECT_VIEW_1_NAME)
472 .setDescription("project view description is not persisted")
473 .setProjectViewAttributes(new ProjectViewAttributes(project.uuid(), analysisDate));
476 private void persistComponents(ComponentDto... componentDtos) {
477 componentDbTester.insertComponents(componentDtos);
480 private ComponentDto getComponentFromDb(String componentKey) {
481 return dbClient.componentDao().selectByKey(dbTester.getSession(), componentKey).get();
484 private void assertRowsCountInTableProjects(int rowCount) {
485 assertThat(dbTester.countRowsOfTable("projects")).isEqualTo(rowCount);
488 private void assertDtoNotUpdated(String componentKey) {
489 assertThat(getComponentFromDb(componentKey).getCreatedAt()).isNotEqualTo(now);
492 private ComponentDto newViewDto(OrganizationDto organizationDto) {
493 return ComponentTesting.newView(organizationDto, VIEW_UUID)
494 .setOrganizationUuid(ORGANIZATION_UUID)
499 private ComponentDto newSubViewDto(ComponentDto rootView) {
500 return ComponentTesting.newSubView(rootView, SUBVIEW_1_UUID, SUBVIEW_1_KEY)
501 .setName(SUBVIEW_1_NAME);
505 * Assertions to verify the DTO created from {@link #createViewBuilder(ViewAttributes.Type)} ()}
507 private void assertDtoIsView(ComponentDto dto) {
508 assertThat(dto.getOrganizationUuid()).isEqualTo(ORGANIZATION_UUID);
509 assertThat(dto.name()).isEqualTo(VIEW_NAME);
510 assertThat(dto.longName()).isEqualTo(VIEW_NAME);
511 assertThat(dto.description()).isEqualTo(VIEW_DESCRIPTION);
512 assertThat(dto.path()).isNull();
513 assertThat(dto.uuid()).isEqualTo(VIEW_UUID);
514 assertThat(dto.projectUuid()).isEqualTo(VIEW_UUID);
515 assertThat(dto.getRootUuid()).isEqualTo(VIEW_UUID);
516 assertThat(dto.moduleUuid()).isNull();
517 assertThat(dto.moduleUuidPath()).isEqualTo("." + dto.uuid() + ".");
518 assertThat(dto.qualifier()).isEqualTo(Qualifiers.VIEW);
519 assertThat(dto.scope()).isEqualTo(Scopes.PROJECT);
520 assertThat(dto.getCopyResourceUuid()).isNull();
521 assertThat(dto.getCreatedAt()).isEqualTo(now);
525 * Assertions to verify the DTO created from {@link #createViewBuilder(ViewAttributes.Type)} ()}
527 private void assertDtoIsApplication(ComponentDto dto) {
528 assertThat(dto.getOrganizationUuid()).isEqualTo(ORGANIZATION_UUID);
529 assertThat(dto.name()).isEqualTo(VIEW_NAME);
530 assertThat(dto.longName()).isEqualTo(VIEW_NAME);
531 assertThat(dto.description()).isEqualTo(VIEW_DESCRIPTION);
532 assertThat(dto.path()).isNull();
533 assertThat(dto.uuid()).isEqualTo(VIEW_UUID);
534 assertThat(dto.projectUuid()).isEqualTo(VIEW_UUID);
535 assertThat(dto.getRootUuid()).isEqualTo(VIEW_UUID);
536 assertThat(dto.moduleUuid()).isNull();
537 assertThat(dto.moduleUuidPath()).isEqualTo("." + dto.uuid() + ".");
538 assertThat(dto.qualifier()).isEqualTo(Qualifiers.APP);
539 assertThat(dto.scope()).isEqualTo(Scopes.PROJECT);
540 assertThat(dto.getCopyResourceUuid()).isNull();
541 assertThat(dto.getCreatedAt()).isEqualTo(now);
545 * Assertions to verify the DTO created from {@link #createProjectView1Builder(ComponentDto, Long)}
547 private void assertDtoIsSubView1(ComponentDto viewDto, ComponentDto sv1Dto) {
548 assertThat(sv1Dto.getOrganizationUuid()).isEqualTo(ORGANIZATION_UUID);
549 assertThat(sv1Dto.name()).isEqualTo(SUBVIEW_1_NAME);
550 assertThat(sv1Dto.longName()).isEqualTo(SUBVIEW_1_NAME);
551 assertThat(sv1Dto.description()).isEqualTo(SUBVIEW_1_DESCRIPTION);
552 assertThat(sv1Dto.path()).isNull();
553 assertThat(sv1Dto.uuid()).isEqualTo(SUBVIEW_1_UUID);
554 assertThat(sv1Dto.projectUuid()).isEqualTo(viewDto.uuid());
555 assertThat(sv1Dto.getRootUuid()).isEqualTo(viewDto.uuid());
556 assertThat(sv1Dto.moduleUuid()).isEqualTo(viewDto.uuid());
557 assertThat(sv1Dto.moduleUuidPath()).isEqualTo(viewDto.moduleUuidPath() + sv1Dto.uuid() + ".");
558 assertThat(sv1Dto.qualifier()).isEqualTo(Qualifiers.SUBVIEW);
559 assertThat(sv1Dto.scope()).isEqualTo(Scopes.PROJECT);
560 assertThat(sv1Dto.getCopyResourceUuid()).isNull();
561 assertThat(sv1Dto.getCreatedAt()).isEqualTo(now);
564 private void assertDtoIsProjectView1(ComponentDto pv1Dto, ComponentDto viewDto, ComponentDto parentViewDto, ComponentDto project) {
565 assertThat(pv1Dto.getOrganizationUuid()).isEqualTo(ORGANIZATION_UUID);
566 assertThat(pv1Dto.name()).isEqualTo(PROJECT_VIEW_1_NAME);
567 assertThat(pv1Dto.longName()).isEqualTo(PROJECT_VIEW_1_NAME);
568 assertThat(pv1Dto.description()).isNull();
569 assertThat(pv1Dto.path()).isNull();
570 assertThat(pv1Dto.uuid()).isEqualTo(PROJECT_VIEW_1_UUID);
571 assertThat(pv1Dto.projectUuid()).isEqualTo(viewDto.uuid());
572 assertThat(pv1Dto.getRootUuid()).isEqualTo(viewDto.uuid());
573 assertThat(pv1Dto.moduleUuid()).isEqualTo(parentViewDto.uuid());
574 assertThat(pv1Dto.moduleUuidPath()).isEqualTo(parentViewDto.moduleUuidPath() + pv1Dto.uuid() + ".");
575 assertThat(pv1Dto.qualifier()).isEqualTo(Qualifiers.PROJECT);
576 assertThat(pv1Dto.scope()).isEqualTo(Scopes.FILE);
577 assertThat(pv1Dto.getCopyResourceUuid()).isEqualTo(project.uuid());
578 assertThat(pv1Dto.getCreatedAt()).isEqualTo(now);