}
@Test
public void jarCreationWithIncludes() throws Exception {
File jar = new File("target/test-app.jar");
Invocation invocation = this.cli.invoke("jar", jar.getAbsolutePath(),
"--include", "-public/**,-resources/**", "jar.groovy");
invocation.await();
assertEquals(invocation.getErrorOutput(), 0, invocation.getErrorOutput().length());
assertTrue(jar.exists());
Process process = new JavaExecutable().processBuilder("-jar",
jar.getAbsolutePath()).start();
invocation = new Invocation(process);
invocation.await();
assertThat(invocation.getErrorOutput(), equalTo(""));
assertThat(invocation.getStandardOutput(), containsString("Hello World!"));
assertThat(invocation.getStandardOutput(),
not(containsString("/public/public.txt")));
assertThat(invocation.getStandardOutput(),
not(containsString("/resources/resource.txt")));
assertThat(invocation.getStandardOutput(), containsString("/static/static.txt"));
assertThat(invocation.getStandardOutput(),
containsString("/templates/template.txt"));
assertThat(invocation.getStandardOutput(), containsString("Goodbye Mama"));
}