use of org.asqatasun.webapp.entity.referential.Referential in project Asqatasun by Asqatasun.
the class CreateContractCommandFactory method addNewReferentialToCommand.
/**
*
* @param ccc
*/
private void addNewReferentialToCommand(CreateContractCommand ccc) {
Map<String, Boolean> refMap = new LinkedHashMap<String, Boolean>();
for (Referential ref : referentialList) {
refMap.put(ref.getCode(), Boolean.FALSE);
}
ccc.setReferentialMap(refMap);
}
use of org.asqatasun.webapp.entity.referential.Referential in project Asqatasun by Asqatasun.
the class CreateContractCommandFactory method addReferentialToCommand.
/**
*
* @param ccc
* @param contract
*/
private void addReferentialToCommand(CreateContractCommand ccc, Contract contract) {
Map<String, Boolean> refMap = new LinkedHashMap<String, Boolean>();
for (Referential ref : referentialList) {
if (contract.getReferentialSet().contains(ref)) {
refMap.put(ref.getCode(), Boolean.TRUE);
} else {
refMap.put(ref.getCode(), Boolean.FALSE);
}
}
ccc.setReferentialMap(refMap);
}
use of org.asqatasun.webapp.entity.referential.Referential in project Asqatasun by Asqatasun.
the class ContractDAOImplTest method testSaveOrUpdate.
/**
* Test of saveOrUpdate method, of class ContractDAOImpl.
*/
public void testSaveOrUpdate() {
System.out.println("saveOrUpdate");
Date beginDate = new Date();
Date endDate = new Date();
Date renewalDate = new Date();
int nbOfContract = contractDAO.findAll().size();
Set<Functionality> functionalitySet = new HashSet<Functionality>();
Set<OptionElement> optionElementSet = new HashSet<OptionElement>();
Set<Referential> referenceSet = new HashSet<Referential>();
Set<Scenario> scenarioSet = new HashSet<Scenario>();
Contract contract = contractFactory.createContract("Contract-test", beginDate, endDate, renewalDate, Float.valueOf(200), functionalitySet, optionElementSet, referenceSet, scenarioSet, null);
contractDAO.saveOrUpdate(contract);
assertEquals(nbOfContract + 1, contractDAO.findAll().size());
}
Aggregations