void () { final FacetManager manager = getFacetManager(); final MyFacetManagerListener listener = new MyFacetManagerListener(); myModule.getProject().getMessageBus().connect(/*getTestRootDisposable()*/).subscribe(FacetManager.FACETS_TOPIC, listener); ModifiableFacetModel model = manager.createModifiableModel(); final MockFacet facet = new MockFacet(myModule, "1"); model.addFacet(facet); assertEquals("", listener.getEvents()); commit(model); assertEquals("before added[1]\nadded[1]\n", listener.getEvents()); FacetManager.getInstance(myModule).facetConfigurationChanged(facet); assertEquals("changed[1]\n", listener.getEvents()); facet.getConfiguration().setData("updated"); FacetManager.getInstance(myModule).facetConfigurationChanged(facet); assertEquals("changed[1]\n", listener.getEvents()); model = manager.createModifiableModel(); model.rename(facet, "3"); assertEquals("", listener.getEvents()); commit(model); assertEquals("before renamed[1]\nrenamed[3]\n", listener.getEvents()); model = manager.createModifiableModel(); model.removeFacet(facet); commit(model); assertEquals("before removed[3]\nremoved[3]\n", listener.getEvents()); model = manager.createModifiableModel(); final MockFacet facet2 = new MockFacet(myModule, "2"); model.addFacet(facet2); model.removeFacet(facet2); commit(model); assertTrue(listener.getEvents().isEmpty()); }