BuildProjectConsoleMode extends BuildProjectCommandMode { protected void resourceChanged(final ResourceChangeEvent event) { logger.info("Resource changed: {}", event); final Resource changedResource = event.getResource(); if (changedResource instanceof PackageResource) { logger.trace("Skip package resource: {}", changedResource.getLocation()); return; } else if (changedResource instanceof BuildResource) { logger.trace("Skip build resource: {}", changedResource.getLocation()); return; } this.build(project); }  void addListener(final DangerousConsumer<BuildDetails> listener); @Override void execute();  }
@Test public void testResourceChanged() throws Exception { final ResourceChangeEvent event = new ResourceChangeEvent(null); buildProject.resourceChanged(event); verify(listener).accept(any()); }