use of org.broadinstitute.consent.http.models.Consent in project consent by DataBiosphere.
the class ConsentDAOTest method testGetAssociationConsentIdsFromDatasetIds.
@Test
public void testGetAssociationConsentIdsFromDatasetIds() {
Consent consent = createConsent(null);
DataSet dataset = createDataset();
createAssociation(consent.getConsentId(), dataset.getDataSetId());
List<Integer> dataSetIds = Stream.of(dataset.getDataSetId()).collect(Collectors.toList());
List<String> consentIds = consentDAO.getAssociationConsentIdsFromDatasetIds(dataSetIds);
assertFalse(consentIds.isEmpty());
assertTrue(consentIds.contains(consent.getConsentId()));
}
use of org.broadinstitute.consent.http.models.Consent in project consent by DataBiosphere.
the class ConsentDAOTest method testFindConsentFromDatasetID.
@Test
public void testFindConsentFromDatasetID() {
DataSet dataset = createDataset();
Consent consent = createConsent(null);
createAssociation(consent.getConsentId(), dataset.getDataSetId());
Consent foundConsent = consentDAO.findConsentFromDatasetID(dataset.getDataSetId());
assertNotNull(foundConsent);
}
use of org.broadinstitute.consent.http.models.Consent in project consent by DataBiosphere.
the class ConsentDAOTest method testUpdateConsentUpdateStatus.
@Test
public void testUpdateConsentUpdateStatus() {
Consent consent1 = createConsent(null);
consentDAO.updateConsent(consent1.getConsentId(), consent1.getRequiresManualReview(), consent1.getUseRestriction().toString(), consent1.getDataUse().toString(), consent1.getDataUseLetter(), consent1.getName(), consent1.getDulName(), new Date(), consent1.getSortDate(), consent1.getTranslatedUseRestriction(), consent1.getGroupName(), true, consent1.getDacId());
Consent consent2 = createConsent(null);
consentDAO.updateConsent(consent2.getConsentId(), consent2.getRequiresManualReview(), consent2.getUseRestriction().toString(), consent2.getDataUse().toString(), consent2.getDataUseLetter(), consent2.getName(), consent2.getDulName(), new Date(), consent2.getSortDate(), consent2.getTranslatedUseRestriction(), consent2.getGroupName(), false, consent2.getDacId());
Consent consent1Found = consentDAO.findConsentById(consent1.getConsentId());
assertTrue(consent1Found.getUpdated());
Consent consent2Found = consentDAO.findConsentById(consent2.getConsentId());
assertFalse(consent2Found.getUpdated());
}
use of org.broadinstitute.consent.http.models.Consent in project consent by DataBiosphere.
the class ConsentDAOTest method testFindAssociationByTypeAndId.
@Test
public void testFindAssociationByTypeAndId() {
DataSet dataset = createDataset();
Consent consent = createConsent(null);
createAssociation(consent.getConsentId(), dataset.getDataSetId());
List<String> associations = consentDAO.findAssociationsByType(consent.getConsentId(), ASSOCIATION_TYPE_TEST);
assertNotNull(associations);
assertFalse(associations.isEmpty());
String objectId = associations.get(0);
String association = consentDAO.findAssociationByTypeAndId(consent.getConsentId(), ASSOCIATION_TYPE_TEST, objectId);
assertNotNull(association);
assertEquals(objectId, association);
}
use of org.broadinstitute.consent.http.models.Consent in project consent by DataBiosphere.
the class ConsentDAOTest method testCheckManualReview.
@Test
public void testCheckManualReview() {
Consent consent = createConsent(null);
Consent consent2 = createConsent(null);
consentDAO.updateConsent(consent2.getConsentId(), true, consent2.getUseRestriction().toString(), consent2.getDataUse().toString(), consent2.getDataUseLetter(), consent2.getName(), consent2.getDulName(), new Date(), consent2.getSortDate(), consent2.getTranslatedUseRestriction(), consent2.getGroupName(), consent2.getUpdated(), consent2.getDacId());
assertFalse(consentDAO.checkManualReview(consent.getConsentId()));
assertTrue(consentDAO.checkManualReview(consent2.getConsentId()));
}
Aggregations