Integration test for ContractService; and refactor Dao