InMemoryPortfolioMaster extends SimpleAbstractInMemoryMaster<PortfolioDocument> implements PortfolioMaster { @Override public void remove(ObjectIdentifiable objectIdentifiable) { ArgumentChecker.notNull(objectIdentifiable, "objectIdentifiable"); PortfolioDocument storedDocument = _store.remove(objectIdentifiable.getObjectId()); if (storedDocument == null) { throw new DataNotFoundException("Portfolio not found " + objectIdentifiable); } removeNodes(storedDocument.getPortfolio().getRootNode()); _changeManager.entityChanged(ChangeType.REMOVED, objectIdentifiable.getObjectId(), null, null, Instant.now()); updateCaches(storedDocument, null); } InMemoryPortfolioMaster();  InMemoryPortfolioMaster(final ChangeManager changeManager);  InMemoryPortfolioMaster(final Supplier<ObjectId> objectIdSupplier);  InMemoryPortfolioMaster(final Supplier<ObjectId> objectIdSupplier, final ChangeManager changeManager); @Override PortfolioDocument get(UniqueId uniqueId); @Override PortfolioDocument get(ObjectIdentifiable objectId, VersionCorrection versionCorrection); @Override PortfolioDocument add(PortfolioDocument document); @Override PortfolioDocument update(PortfolioDocument document); @Override void remove(ObjectIdentifiable objectIdentifiable); @Override PortfolioDocument correct(PortfolioDocument document); @Override PortfolioSearchResult search(PortfolioSearchRequest request); @Override PortfolioHistoryResult history(PortfolioHistoryRequest request); @Override ManageablePortfolioNode getNode(UniqueId nodeId); static final String DEFAULT_OID_SCHEME; }
@Test(expectedExceptions = DataNotFoundException.class) public void test_remove_emptyMaster() { _emptyMaster.remove(UniqueId.of("MemPrt", "1")); }