QueryResult<Cohort> insert(long studyId, Cohort cohort, List<VariableSet> variableSetList, QueryOptions options) throws CatalogDBException;
threads.add(new Thread(() -> { try { dbAdaptorFactory.getCatalogCohortDBAdaptor().insert(studyId, new Cohort(cohortName, Study.Type.COLLECTION, "", "", Collections.emptyList(), 1, null), null); } catch (CatalogException ignore) {
@Test @Ignore // TODO: This should be tested in the sample manager, not here !!! public void deleteSampleFail3Test() throws Exception { long studyId = user3.getProjects().get(0).getStudies().get(0).getUid(); Sample hg0097 = new Sample("HG0097", "1000g", new Individual(), "A description", 1); QueryResult<Sample> createResult = dbAdaptorFactory.getCatalogSampleDBAdaptor().insert(studyId, hg0097, null); dbAdaptorFactory.getCatalogCohortDBAdaptor().insert(studyId, new Cohort("Cohort", Study.Type.COLLECTION, "", "", Collections.singletonList(createResult.first()), 1, null), null); thrown.expect(CatalogDBException.class); dbAdaptorFactory.getCatalogSampleDBAdaptor().delete(createResult.first().getUid()); }
QueryResult<Cohort> queryResult = cohortDBAdaptor.insert(study.getUid(), cohort, variableSetList, null); auditManager.recordCreation(AuditRecord.Resource.cohort, queryResult.first().getUid(), userId, queryResult.first(), null, null); return queryResult;