@Test public void invalidAspectNameSpaceThrowsException() throws Exception { when(badAspect).create(); then(logging) .errorMessageReceived( AbstractNode.Messages.NODE_CREATION_FAILED_LOG_MSG, "Aspect", badAspect.dir()) .and(exceptions) .verifyException(InvalidDirectoryNameException.class, badAspect.dir(), unquoted("'!#*'")); }
@Test public void populatingAnAspectCausesRootObserversToBeNotified() throws Exception { given(observer).observing(brjs); when(aspect).populate(); then(observer) .notified(NodeReadyEvent.class, aspect) .and(observer) .notified(NodeReadyEvent.class, aspect.theme("standard")); }
@Test public void parentGivesTheCorrectNode() throws Exception { when(aspect).create(); then(aspect.parent()).isSameAs(app); }