-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
ReportPersistSnapshotsStepTest.java
381 lines (313 loc) · 20.4 KB
/
ReportPersistSnapshotsStepTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
/*
* SonarQube, open source software quality management tool.
* Copyright (C) 2008-2014 SonarSource
* mailto:contact AT sonarsource DOT com
*
* SonarQube is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* SonarQube is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.sonar.server.computation.step;
import java.util.Date;
import java.util.List;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.sonar.api.CoreProperties;
import org.sonar.api.utils.DateUtils;
import org.sonar.api.utils.System2;
import org.sonar.db.DbClient;
import org.sonar.db.DbTester;
import org.sonar.db.component.ComponentDto;
import org.sonar.db.component.SnapshotDto;
import org.sonar.db.component.SnapshotQuery;
import org.sonar.db.component.ComponentTesting;
import org.sonar.server.component.SnapshotTesting;
import org.sonar.server.computation.analysis.MutableAnalysisMetadataHolderRule;
import org.sonar.server.computation.batch.TreeRootHolderRule;
import org.sonar.server.computation.component.Component;
import org.sonar.server.computation.component.DbIdsRepositoryImpl;
import org.sonar.server.computation.component.ReportComponent;
import org.sonar.server.computation.component.FileAttributes;
import org.sonar.server.computation.period.Period;
import org.sonar.server.computation.period.PeriodsHolderRule;
import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@Category(DbTests.class)
public class ReportPersistSnapshotsStepTest extends BaseStepTest {
private static final String PROJECT_KEY = "PROJECT_KEY";
@Rule
public DbTester dbTester = DbTester.create(System2.INSTANCE);
@Rule
public TreeRootHolderRule treeRootHolder = new TreeRootHolderRule();
@Rule
public MutableAnalysisMetadataHolderRule analysisMetadataHolder = new MutableAnalysisMetadataHolderRule();
@Rule
public PeriodsHolderRule periodsHolder = new PeriodsHolderRule();
System2 system2 = mock(System2.class);
DbIdsRepositoryImpl dbIdsRepository;
DbClient dbClient = dbTester.getDbClient();
long analysisDate;
long now;
PersistSnapshotsStep underTest;
@Before
public void setup() {
dbTester.truncateTables();
analysisDate = DateUtils.parseDateQuietly("2015-06-01").getTime();
analysisMetadataHolder.setAnalysisDate(new Date(analysisDate));
dbIdsRepository = new DbIdsRepositoryImpl();
now = DateUtils.parseDateQuietly("2015-06-02").getTime();
when(system2.now()).thenReturn(now);
underTest = new PersistSnapshotsStep(system2, dbClient, treeRootHolder, analysisMetadataHolder, dbIdsRepository, periodsHolder);
// initialize PeriodHolder to empty by default
periodsHolder.setPeriods();
}
@Override
protected ComputationStep step() {
return underTest;
}
@Test
public void persist_snapshots() {
ComponentDto projectDto = ComponentTesting.newProjectDto("ABCD").setKey(PROJECT_KEY).setName("Project");
dbClient.componentDao().insert(dbTester.getSession(), projectDto);
ComponentDto moduleDto = ComponentTesting.newModuleDto("BCDE", projectDto).setKey("MODULE_KEY").setName("Module");
dbClient.componentDao().insert(dbTester.getSession(), moduleDto);
ComponentDto directoryDto = ComponentTesting.newDirectory(moduleDto, "CDEF", "MODULE_KEY:src/main/java/dir").setKey("MODULE_KEY:src/main/java/dir");
dbClient.componentDao().insert(dbTester.getSession(), directoryDto);
ComponentDto fileDto = ComponentTesting.newFileDto(moduleDto, "DEFG").setKey("MODULE_KEY:src/main/java/dir/Foo.java");
dbClient.componentDao().insert(dbTester.getSession(), fileDto);
dbTester.getSession().commit();
Component file = ReportComponent.builder(Component.Type.FILE, 4).setUuid("DEFG").setKey("MODULE_KEY:src/main/java/dir/Foo.java").build();
Component directory = ReportComponent.builder(Component.Type.DIRECTORY, 3).setUuid("CDEF").setKey("MODULE_KEY:src/main/java/dir").addChildren(file).build();
Component module = ReportComponent.builder(Component.Type.MODULE, 2).setUuid("BCDE").setKey("MODULE_KEY").setVersion("1.1").addChildren(directory).build();
Component project = ReportComponent.builder(Component.Type.PROJECT, 1).setUuid("ABCD").setKey(PROJECT_KEY).setVersion("1.0").addChildren(module).build();
treeRootHolder.setRoot(project);
dbIdsRepository.setComponentId(project, projectDto.getId());
dbIdsRepository.setComponentId(module, moduleDto.getId());
dbIdsRepository.setComponentId(directory, directoryDto.getId());
dbIdsRepository.setComponentId(file, fileDto.getId());
underTest.execute();
assertThat(dbTester.countRowsOfTable("snapshots")).isEqualTo(4);
SnapshotDto projectSnapshot = getUnprocessedSnapshot(projectDto.getId());
assertThat(projectSnapshot.getComponentId()).isEqualTo(projectDto.getId());
assertThat(projectSnapshot.getRootProjectId()).isEqualTo(projectDto.getId());
assertThat(projectSnapshot.getRootId()).isNull();
assertThat(projectSnapshot.getParentId()).isNull();
assertThat(projectSnapshot.getDepth()).isEqualTo(0);
assertThat(projectSnapshot.getPath()).isNullOrEmpty();
assertThat(projectSnapshot.getQualifier()).isEqualTo("TRK");
assertThat(projectSnapshot.getScope()).isEqualTo("PRJ");
assertThat(projectSnapshot.getVersion()).isEqualTo("1.0");
assertThat(projectSnapshot.getLast()).isFalse();
assertThat(projectSnapshot.getStatus()).isEqualTo("U");
assertThat(projectSnapshot.getCreatedAt()).isEqualTo(analysisDate);
assertThat(projectSnapshot.getBuildDate()).isEqualTo(now);
SnapshotDto moduleSnapshot = getUnprocessedSnapshot(moduleDto.getId());
assertThat(moduleSnapshot.getComponentId()).isEqualTo(moduleDto.getId());
assertThat(moduleSnapshot.getRootProjectId()).isEqualTo(projectDto.getId());
assertThat(moduleSnapshot.getRootId()).isEqualTo(projectSnapshot.getId());
assertThat(moduleSnapshot.getParentId()).isEqualTo(projectSnapshot.getId());
assertThat(moduleSnapshot.getDepth()).isEqualTo(1);
assertThat(moduleSnapshot.getPath()).isEqualTo(projectSnapshot.getId() + ".");
assertThat(moduleSnapshot.getQualifier()).isEqualTo("BRC");
assertThat(moduleSnapshot.getScope()).isEqualTo("PRJ");
assertThat(moduleSnapshot.getVersion()).isEqualTo("1.1");
assertThat(moduleSnapshot.getLast()).isFalse();
assertThat(moduleSnapshot.getStatus()).isEqualTo("U");
assertThat(moduleSnapshot.getCreatedAt()).isEqualTo(analysisDate);
assertThat(moduleSnapshot.getBuildDate()).isEqualTo(now);
SnapshotDto directorySnapshot = getUnprocessedSnapshot(directoryDto.getId());
assertThat(directorySnapshot.getComponentId()).isEqualTo(directoryDto.getId());
assertThat(directorySnapshot.getRootProjectId()).isEqualTo(projectDto.getId());
assertThat(directorySnapshot.getRootId()).isEqualTo(projectSnapshot.getId());
assertThat(directorySnapshot.getParentId()).isEqualTo(moduleSnapshot.getId());
assertThat(directorySnapshot.getDepth()).isEqualTo(2);
assertThat(directorySnapshot.getPath()).isEqualTo(projectSnapshot.getId() + "." + moduleSnapshot.getId() + ".");
assertThat(directorySnapshot.getQualifier()).isEqualTo("DIR");
assertThat(directorySnapshot.getScope()).isEqualTo("DIR");
assertThat(directorySnapshot.getVersion()).isNull();
assertThat(directorySnapshot.getLast()).isFalse();
assertThat(directorySnapshot.getStatus()).isEqualTo("U");
assertThat(directorySnapshot.getCreatedAt()).isEqualTo(analysisDate);
assertThat(directorySnapshot.getBuildDate()).isEqualTo(now);
SnapshotDto fileSnapshot = getUnprocessedSnapshot(fileDto.getId());
assertThat(fileSnapshot.getComponentId()).isEqualTo(fileDto.getId());
assertThat(fileSnapshot.getRootProjectId()).isEqualTo(projectDto.getId());
assertThat(fileSnapshot.getRootId()).isEqualTo(projectSnapshot.getId());
assertThat(fileSnapshot.getParentId()).isEqualTo(directorySnapshot.getId());
assertThat(fileSnapshot.getDepth()).isEqualTo(3);
assertThat(fileSnapshot.getPath()).isEqualTo(projectSnapshot.getId() + "." + moduleSnapshot.getId() + "." + directorySnapshot.getId() + ".");
assertThat(fileSnapshot.getQualifier()).isEqualTo("FIL");
assertThat(fileSnapshot.getScope()).isEqualTo("FIL");
assertThat(fileSnapshot.getVersion()).isNull();
assertThat(fileSnapshot.getLast()).isFalse();
assertThat(fileSnapshot.getStatus()).isEqualTo("U");
assertThat(fileSnapshot.getCreatedAt()).isEqualTo(analysisDate);
assertThat(fileSnapshot.getBuildDate()).isEqualTo(now);
assertThat(dbIdsRepository.getSnapshotId(project)).isEqualTo(projectSnapshot.getId());
assertThat(dbIdsRepository.getComponentId(module)).isEqualTo(moduleDto.getId());
assertThat(dbIdsRepository.getComponentId(directory)).isEqualTo(directoryDto.getId());
assertThat(dbIdsRepository.getComponentId(file)).isEqualTo(fileDto.getId());
}
@Test
public void persist_unit_test() {
ComponentDto projectDto = ComponentTesting.newProjectDto("ABCD").setKey(PROJECT_KEY).setName("Project");
dbClient.componentDao().insert(dbTester.getSession(), projectDto);
ComponentDto moduleDto = ComponentTesting.newModuleDto("BCDE", projectDto).setKey("MODULE_KEY").setName("Module");
dbClient.componentDao().insert(dbTester.getSession(), moduleDto);
ComponentDto directoryDto = ComponentTesting.newDirectory(moduleDto, "CDEF", "MODULE_KEY:src/test/java/dir").setKey("MODULE_KEY:src/test/java/dir");
dbClient.componentDao().insert(dbTester.getSession(), directoryDto);
ComponentDto fileDto = ComponentTesting.newFileDto(moduleDto, "DEFG").setKey("MODULE_KEY:src/test/java/dir/FooTest.java").setQualifier("UTS");
dbClient.componentDao().insert(dbTester.getSession(), fileDto);
dbTester.getSession().commit();
Component file = ReportComponent.builder(Component.Type.FILE, 3).setUuid("DEFG").setKey(PROJECT_KEY + ":src/main/java/dir/Foo.java").setFileAttributes(new FileAttributes(true, null)).build();
Component directory = ReportComponent.builder(Component.Type.DIRECTORY, 2).setUuid("CDEF").setKey(PROJECT_KEY + ":src/main/java/dir").addChildren(file).build();
Component project = ReportComponent.builder(Component.Type.PROJECT, 1).setUuid("ABCD").setKey(PROJECT_KEY).addChildren(directory).build();
treeRootHolder.setRoot(project);
dbIdsRepository.setComponentId(project, projectDto.getId());
dbIdsRepository.setComponentId(directory, directoryDto.getId());
dbIdsRepository.setComponentId(file, fileDto.getId());
underTest.execute();
SnapshotDto fileSnapshot = getUnprocessedSnapshot(fileDto.getId());
assertThat(fileSnapshot.getQualifier()).isEqualTo("UTS");
assertThat(fileSnapshot.getScope()).isEqualTo("FIL");
}
@Test
public void persist_snapshots_on_multi_modules() {
ComponentDto projectDto = ComponentTesting.newProjectDto("ABCD").setKey(PROJECT_KEY);
dbClient.componentDao().insert(dbTester.getSession(), projectDto);
ComponentDto moduleADto = ComponentTesting.newModuleDto("BCDE", projectDto).setKey("MODULE_A");
dbClient.componentDao().insert(dbTester.getSession(), moduleADto);
ComponentDto subModuleADto = ComponentTesting.newModuleDto("CDEF", moduleADto).setKey("SUB_MODULE_A");
dbClient.componentDao().insert(dbTester.getSession(), subModuleADto);
ComponentDto moduleBDto = ComponentTesting.newModuleDto("DEFG", projectDto).setKey("MODULE_B");
dbClient.componentDao().insert(dbTester.getSession(), moduleBDto);
dbTester.getSession().commit();
Component moduleB = ReportComponent.builder(Component.Type.MODULE, 4).setUuid("DEFG").setKey("MODULE_B").build();
Component subModuleA = ReportComponent.builder(Component.Type.MODULE, 3).setUuid("CDEF").setKey("SUB_MODULE_A").build();
Component moduleA = ReportComponent.builder(Component.Type.MODULE, 2).setUuid("BCDE").setKey("MODULE_A").addChildren(subModuleA).build();
Component project = ReportComponent.builder(Component.Type.PROJECT, 1).setUuid("ABCD").setKey(PROJECT_KEY).addChildren(moduleA, moduleB).build();
treeRootHolder.setRoot(project);
dbIdsRepository.setComponentId(project, projectDto.getId());
dbIdsRepository.setComponentId(moduleA, moduleADto.getId());
dbIdsRepository.setComponentId(subModuleA, subModuleADto.getId());
dbIdsRepository.setComponentId(moduleB, moduleBDto.getId());
underTest.execute();
assertThat(dbTester.countRowsOfTable("snapshots")).isEqualTo(4);
SnapshotDto projectSnapshot = getUnprocessedSnapshot(projectDto.getId());
assertThat(projectSnapshot.getRootProjectId()).isEqualTo(projectDto.getId());
assertThat(projectSnapshot.getRootId()).isNull();
assertThat(projectSnapshot.getParentId()).isNull();
assertThat(projectSnapshot.getDepth()).isEqualTo(0);
assertThat(projectSnapshot.getPath()).isNullOrEmpty();
SnapshotDto moduleASnapshot = getUnprocessedSnapshot(moduleADto.getId());
assertThat(moduleASnapshot.getRootProjectId()).isEqualTo(projectDto.getId());
assertThat(moduleASnapshot.getRootId()).isEqualTo(projectSnapshot.getId());
assertThat(moduleASnapshot.getParentId()).isEqualTo(projectSnapshot.getId());
assertThat(moduleASnapshot.getDepth()).isEqualTo(1);
assertThat(moduleASnapshot.getPath()).isEqualTo(projectSnapshot.getId() + ".");
SnapshotDto subModuleASnapshot = getUnprocessedSnapshot(subModuleADto.getId());
assertThat(subModuleASnapshot.getRootProjectId()).isEqualTo(projectDto.getId());
assertThat(subModuleASnapshot.getRootId()).isEqualTo(projectSnapshot.getId());
assertThat(subModuleASnapshot.getParentId()).isEqualTo(moduleASnapshot.getId());
assertThat(subModuleASnapshot.getDepth()).isEqualTo(2);
assertThat(subModuleASnapshot.getPath()).isEqualTo(projectSnapshot.getId() + "." + moduleASnapshot.getId() + ".");
SnapshotDto moduleBSnapshot = getUnprocessedSnapshot(moduleBDto.getId());
assertThat(moduleBSnapshot.getRootProjectId()).isEqualTo(projectDto.getId());
assertThat(moduleBSnapshot.getRootId()).isEqualTo(projectSnapshot.getId());
assertThat(moduleBSnapshot.getParentId()).isEqualTo(projectSnapshot.getId());
assertThat(moduleBSnapshot.getDepth()).isEqualTo(1);
assertThat(moduleBSnapshot.getPath()).isEqualTo(projectSnapshot.getId() + ".");
}
@Test
public void persist_snapshots_with_periods() {
ComponentDto projectDto = ComponentTesting.newProjectDto("ABCD").setKey(PROJECT_KEY).setName("Project");
dbClient.componentDao().insert(dbTester.getSession(), projectDto);
SnapshotDto snapshotDto = SnapshotTesting.createForProject(projectDto).setCreatedAt(DateUtils.parseDateQuietly("2015-01-01").getTime());
dbClient.snapshotDao().insert(dbTester.getSession(), snapshotDto);
dbTester.getSession().commit();
periodsHolder.setPeriods(new Period(1, CoreProperties.TIMEMACHINE_MODE_DATE, "2015-01-01", analysisDate, 123L));
Component project = ReportComponent.builder(Component.Type.PROJECT, 1).setUuid("ABCD").setKey(PROJECT_KEY).build();
treeRootHolder.setRoot(project);
dbIdsRepository.setComponentId(project, projectDto.getId());
underTest.execute();
SnapshotDto projectSnapshot = getUnprocessedSnapshot(projectDto.getId());
assertThat(projectSnapshot.getPeriodMode(1)).isEqualTo(CoreProperties.TIMEMACHINE_MODE_DATE);
assertThat(projectSnapshot.getPeriodDate(1)).isEqualTo(analysisDate);
assertThat(projectSnapshot.getPeriodModeParameter(1)).isNotNull();
}
@Test
public void only_persist_snapshots_with_periods_on_project_and_module() {
periodsHolder.setPeriods(new Period(1, CoreProperties.TIMEMACHINE_MODE_PREVIOUS_ANALYSIS, null, analysisDate, 123L));
ComponentDto projectDto = ComponentTesting.newProjectDto("ABCD").setKey(PROJECT_KEY).setName("Project");
dbClient.componentDao().insert(dbTester.getSession(), projectDto);
SnapshotDto projectSnapshot = SnapshotTesting.createForProject(projectDto);
dbClient.snapshotDao().insert(dbTester.getSession(), projectSnapshot);
ComponentDto moduleDto = ComponentTesting.newModuleDto("BCDE", projectDto).setKey("MODULE_KEY").setName("Module");
dbClient.componentDao().insert(dbTester.getSession(), moduleDto);
SnapshotDto moduleSnapshot = SnapshotTesting.createForComponent(moduleDto, projectSnapshot);
dbClient.snapshotDao().insert(dbTester.getSession(), moduleSnapshot);
ComponentDto directoryDto = ComponentTesting.newDirectory(moduleDto, "CDEF", "MODULE_KEY:src/main/java/dir").setKey("MODULE_KEY:src/main/java/dir");
dbClient.componentDao().insert(dbTester.getSession(), directoryDto);
SnapshotDto directorySnapshot = SnapshotTesting.createForComponent(directoryDto, moduleSnapshot);
dbClient.snapshotDao().insert(dbTester.getSession(), directorySnapshot);
ComponentDto fileDto = ComponentTesting.newFileDto(moduleDto, "DEFG").setKey("MODULE_KEY:src/main/java/dir/Foo.java");
dbClient.componentDao().insert(dbTester.getSession(), fileDto);
SnapshotDto fileSnapshot = SnapshotTesting.createForComponent(fileDto, directorySnapshot);
dbClient.snapshotDao().insert(dbTester.getSession(), fileSnapshot);
dbTester.getSession().commit();
Component file = ReportComponent.builder(Component.Type.FILE, 4).setUuid("DEFG").setKey("MODULE_KEY:src/main/java/dir/Foo.java").build();
Component directory = ReportComponent.builder(Component.Type.DIRECTORY, 3).setUuid("CDEF").setKey("MODULE_KEY:src/main/java/dir").addChildren(file).build();
Component module = ReportComponent.builder(Component.Type.MODULE, 2).setUuid("BCDE").setKey("MODULE_KEY").addChildren(directory).build();
Component project = ReportComponent.builder(Component.Type.PROJECT, 1).setUuid("ABCD").setKey(PROJECT_KEY).addChildren(module).build();
treeRootHolder.setRoot(project);
dbIdsRepository.setComponentId(project, projectDto.getId());
dbIdsRepository.setComponentId(module, moduleDto.getId());
dbIdsRepository.setComponentId(directory, directoryDto.getId());
dbIdsRepository.setComponentId(file, fileDto.getId());
underTest.execute();
SnapshotDto newProjectSnapshot = getUnprocessedSnapshot(projectDto.getId());
assertThat(newProjectSnapshot.getPeriodMode(1)).isEqualTo(CoreProperties.TIMEMACHINE_MODE_PREVIOUS_ANALYSIS);
SnapshotDto newModuleSnapshot = getUnprocessedSnapshot(moduleDto.getId());
assertThat(newModuleSnapshot.getPeriodMode(1)).isEqualTo(CoreProperties.TIMEMACHINE_MODE_PREVIOUS_ANALYSIS);
SnapshotDto newDirectorySnapshot = getUnprocessedSnapshot(directoryDto.getId());
assertThat(newDirectorySnapshot.getPeriodMode(1)).isNull();
SnapshotDto newFileSnapshot = getUnprocessedSnapshot(fileDto.getId());
assertThat(newFileSnapshot.getPeriodMode(1)).isNull();
}
@Test
public void set_no_period_on_snapshots_when_no_period() {
ComponentDto projectDto = ComponentTesting.newProjectDto("ABCD").setKey(PROJECT_KEY).setName("Project");
dbClient.componentDao().insert(dbTester.getSession(), projectDto);
SnapshotDto snapshotDto = SnapshotTesting.createForProject(projectDto);
dbClient.snapshotDao().insert(dbTester.getSession(), snapshotDto);
dbTester.getSession().commit();
Component project = ReportComponent.builder(Component.Type.PROJECT, 1).setUuid("ABCD").setKey(PROJECT_KEY).build();
treeRootHolder.setRoot(project);
dbIdsRepository.setComponentId(project, projectDto.getId());
underTest.execute();
SnapshotDto projectSnapshot = getUnprocessedSnapshot(projectDto.getId());
assertThat(projectSnapshot.getPeriodMode(1)).isNull();
assertThat(projectSnapshot.getPeriodDate(1)).isNull();
assertThat(projectSnapshot.getPeriodModeParameter(1)).isNull();
}
private SnapshotDto getUnprocessedSnapshot(long componentId) {
List<SnapshotDto> projectSnapshots = dbClient.snapshotDao().selectSnapshotsByQuery(dbTester.getSession(),
new SnapshotQuery().setComponentId(componentId).setIsLast(false).setStatus(SnapshotDto.STATUS_UNPROCESSED));
assertThat(projectSnapshots).hasSize(1);
return projectSnapshots.get(0);
}
}