use of org.sagebionetworks.bridge.models.Criteria in project BridgeServer2 by Sage-Bionetworks.
the class DynamoAppConfigDao method createAppConfig.
public AppConfig createAppConfig(AppConfig appConfig) {
checkNotNull(appConfig);
appConfig.setDeleted(false);
Criteria criteria = persistCriteria(appConfig);
appConfig.setCriteria(criteria);
mapper.save(appConfig);
return appConfig;
}
use of org.sagebionetworks.bridge.models.Criteria in project BridgeServer2 by Sage-Bionetworks.
the class DynamoAppConfigDao method loadCriteria.
private void loadCriteria(AppConfig config) {
Criteria criteria = criteriaDao.getCriteria(getKey(config));
if (criteria == null) {
criteria = Criteria.create();
}
criteria.setKey(getKey(config));
config.setCriteria(criteria);
}
use of org.sagebionetworks.bridge.models.Criteria in project BridgeServer2 by Sage-Bionetworks.
the class DynamoAppConfigDao method persistCriteria.
private Criteria persistCriteria(AppConfig config) {
Criteria criteria = config.getCriteria();
criteria.setKey(getKey(config));
return criteriaDao.createOrUpdateCriteria(criteria);
}
use of org.sagebionetworks.bridge.models.Criteria in project BridgeServer2 by Sage-Bionetworks.
the class TestUtilsTest method newCriteria.
private Criteria newCriteria() {
// Don't use an interface method, that's what we're testing here.
Criteria criteria = new DynamoCriteria();
criteria.setMinAppVersion(IOS, 5);
criteria.setMaxAppVersion(IOS, 15);
criteria.setMaxAppVersion(ANDROID, 12);
criteria.setAllOfGroups(ALL_OF_GROUPS);
criteria.setNoneOfGroups(NONE_OF_GROUPS);
return criteria;
}
use of org.sagebionetworks.bridge.models.Criteria in project BridgeServer2 by Sage-Bionetworks.
the class DynamoAppConfigDaoTest method createAppConfig.
@Test
public void createAppConfig() {
AppConfig config = AppConfig.create();
// verify this cannot be created true
config.setDeleted(true);
// set in AppConfigService
config.setGuid(GUID);
Criteria criteria = Criteria.create();
config.setCriteria(criteria);
AppConfig result = dao.createAppConfig(config);
assertSame(result, config);
assertFalse(result.isDeleted());
assertEquals(criteria.getKey(), CRITERIA_KEY);
verify(mockMapper).save(config);
verify(mockCriteriaDao).createOrUpdateCriteria(criteria);
}
Aggregations