@Test
public void mustInstrumentClasses() throws Exception {

    byte[] classContent = readZipFromResource("NormalInvokeTest.zip").get("NormalInvokeTest.class");
    
    File mainDir = null;
    try {
        // write out
        mainDir = Files.createTempDirectory(getClass().getSimpleName()).toFile();
        File mainClass = new File(mainDir, "NormalInvokeTest.class");
        FileUtils.writeByteArrayToFile(mainClass, classContent);
        
        // mock
        Mockito.when(mavenProject.getCompileClasspathElements()).thenReturn(Collections.emptyList());
        Build build = Mockito.mock(Build.class);
        Mockito.when(mavenProject.getBuild()).thenReturn(build);
        Mockito.when(build.getOutputDirectory()).thenReturn(mainDir.getAbsolutePath());
        
        // execute plugin
        fixture.execute();
        
        // read back in
        byte[] modifiedMainClassContent = FileUtils.readFileToByteArray(mainClass);
        
        // test
        assertTrue(modifiedMainClassContent.length > classContent.length);
    } finally {
        if (mainDir != null) {
            FileUtils.deleteDirectory(mainDir);
        }
    }
}