ContractRegistry { public ContractInfo getContractInfo(CtClass contractClass) { return contractMap.get(contractClass); } ContractRegistry(); ContractInfo registerContract(CtClass targetClass, CtClass contractClass); ContractInfo getContractInfo(CtClass contractClass); boolean isContractClass(CtClass clazz); boolean hasRegisteredContract(CtClass targetClass); ContractInfo getContractInfoForTargetClass(CtClass targetClass); CtClass getExternalContract(CtClass type, CtClass affectedClass); ListOrderedSet<ContractInfo> getContractsForTypes(ListOrderedSet<CtClass> types, CtClass affectedClass); void registerExternalContract(XmlLocalConfiguration xmlLocalConfiguration); static final ContractRegistry INSTANCE; }
@Test public void testGetContractInfo() { assertNull(contractRegistry.getContractInfo(contractClass)); ContractInfo contractInfo = contractRegistry.registerContract(targetClass, contractClass); assertEquals(contractInfo, contractRegistry.getContractInfo(contractClass)); }