DynamicDelegatingPortfolioMaster implements PortfolioMaster { @Override public PortfolioDocument get(UniqueId uniqueId) { ArgumentChecker.notNull(uniqueId, "uniqueId"); return chooseDelegate(uniqueId.getScheme()).get(uniqueId); } DynamicDelegatingPortfolioMaster(); void register(final String scheme, final PortfolioMaster delegate); void deregister(final String scheme); PortfolioDocument add(final String scheme, final PortfolioDocument document); @Override PortfolioSearchResult search(PortfolioSearchRequest request); @Override PortfolioHistoryResult history(PortfolioHistoryRequest request); @Override ManageablePortfolioNode getNode(UniqueId nodeId); @Override PortfolioDocument get(UniqueId uniqueId); @Override PortfolioDocument get(ObjectIdentifiable objectId, VersionCorrection versionCorrection); @Override Map<UniqueId, PortfolioDocument> get(Collection<UniqueId> uniqueIds); @Override PortfolioDocument add(PortfolioDocument document); @Override PortfolioDocument update(PortfolioDocument document); @Override void remove(ObjectIdentifiable oid); @Override PortfolioDocument correct(PortfolioDocument document); @Override List<UniqueId> replaceVersion(UniqueId uniqueId, List<PortfolioDocument> replacementDocuments); @Override List<UniqueId> replaceAllVersions(ObjectIdentifiable objectId, List<PortfolioDocument> replacementDocuments); @Override List<UniqueId> replaceVersions(ObjectIdentifiable objectId, List<PortfolioDocument> replacementDocuments); @Override UniqueId replaceVersion(PortfolioDocument replacementDocument); @Override void removeVersion(UniqueId uniqueId); @Override UniqueId addVersion(ObjectIdentifiable objectId, PortfolioDocument documentToAdd); @Override ChangeManager changeManager();  }
@Test(expectedExceptions = DataNotFoundException.class) void test_DefaultDelegateShouldNotFindAnyData() { final UniqueId doesNotExist = UniqueId.of(schemeA,"DoesNotExist"); DynamicDelegatingPortfolioMaster sut = new DynamicDelegatingPortfolioMaster(); sut.get(doesNotExist); }