@Before
public void setUp() {
- ComponentDto project = ComponentTesting.newPrivateProjectDto();
- dbTester.components().insertComponent(project);
+ ComponentDto project = dbTester.components().insertPrivateProject().getMainBranchComponent();
SnapshotDto projectSnapshot = SnapshotTesting.newAnalysis(project);
dbClient.snapshotDao().insert(dbSession, projectSnapshot);
dbSession.commit();
}
private ComponentDto createProject(String projectKey) {
- ComponentDto project = ComponentTesting.newPrivateProjectDto().setKey(projectKey);
- return dbTester.components().insertComponent(project);
+ return dbTester.components().insertPrivateProject(p->p.setKey(projectKey)).getMainBranchComponent();
}
private SnapshotDto createProjectSnapshot(ComponentDto project) {
public class DuplicationDaoIT {
@Rule
- public DbTester db = DbTester.create(System2.INSTANCE);
+ public DbTester db = DbTester.create(System2.INSTANCE, true);
private final DbSession dbSession = db.getSession();
private final DuplicationDao dao = db.getDbClient().duplicationDao();