Reformat
diff --git a/src/test/java/org/apache/maven/buildcache/its/ForkedExecutionCoreExtensionTest.java b/src/test/java/org/apache/maven/buildcache/its/ForkedExecutionCoreExtensionTest.java
index 1650117..d111834 100644
--- a/src/test/java/org/apache/maven/buildcache/its/ForkedExecutionCoreExtensionTest.java
+++ b/src/test/java/org/apache/maven/buildcache/its/ForkedExecutionCoreExtensionTest.java
@@ -66,10 +66,11 @@
verifier.verifyTextInLog("Started forked project");
// forked execution actually runs
verifier.verifyTextInLog(
- "[DEBUG] Starting mojo execution: pmd:pmd:emptyLifecyclePhase:maven-pmd-plugin:org.apache.maven.plugins" );
+ "[DEBUG] Starting mojo execution: pmd:pmd:emptyLifecyclePhase:maven-pmd-plugin:org.apache.maven.plugins");
// checking that forked execution doesn't hook into lifecycle
- assertThrows(VerificationException.class, () ->
- verifier.verifyTextInLog(
+ assertThrows(
+ VerificationException.class,
+ () -> verifier.verifyTextInLog(
"Mojo execution pmd:pmd:emptyLifecyclePhase:maven-pmd-plugin:org.apache.maven.plugins is forked,"
+ " returning phase verify from originating mojo "
+ "default:check:verify:maven-pmd-plugin:org.apache.maven.plugins"));
@@ -80,13 +81,16 @@
verifier.verifyErrorFreeLog();
verifier.verifyTextInLog("Found cached build, restoring " + PROJECT_NAME + " from cache");
// checking that fork originating mojo pmd:check is cached
- verifier.verifyTextInLog( "[INFO] Skipping plugin execution (cached): pmd:check" );
+ verifier.verifyTextInLog("[INFO] Skipping plugin execution (cached): pmd:check");
// and because of that forked execution pmd:pmd didn't run
- assertThrows(VerificationException.class, () -> verifier.verifyTextInLog(
- "[DEBUG] Starting mojo execution: pmd:pmd:emptyLifecyclePhase:maven-pmd-plugin:org.apache.maven.plugins"));
+ assertThrows(
+ VerificationException.class,
+ () -> verifier.verifyTextInLog(
+ "[DEBUG] Starting mojo execution: pmd:pmd:emptyLifecyclePhase:maven-pmd-plugin:org.apache.maven.plugins"));
// and didn't appear in cache lifecycle
- assertThrows(VerificationException.class, () -> verifier.verifyTextInLog(
- "[INFO] Skipping plugin execution (cached): pmd:pmd"));
+ assertThrows(
+ VerificationException.class,
+ () -> verifier.verifyTextInLog("[INFO] Skipping plugin execution (cached): pmd:pmd"));
verifier.verifyTextInLog("[INFO] BUILD SUCCESS");
}
}
diff --git a/src/test/java/org/apache/maven/buildcache/its/ForkedExecutionsTest.java b/src/test/java/org/apache/maven/buildcache/its/ForkedExecutionsTest.java
index 6349c63..aa9bbb9 100644
--- a/src/test/java/org/apache/maven/buildcache/its/ForkedExecutionsTest.java
+++ b/src/test/java/org/apache/maven/buildcache/its/ForkedExecutionsTest.java
@@ -7,7 +7,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
@@ -18,15 +18,14 @@
*/
package org.apache.maven.buildcache.its;
-import com.github.tomakehurst.wiremock.common.ConsoleNotifier;
-import com.github.tomakehurst.wiremock.junit5.WireMockExtension;
-import com.github.tomakehurst.wiremock.matching.UrlPathPattern;
-import com.google.common.collect.Lists;
-
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
+import com.github.tomakehurst.wiremock.common.ConsoleNotifier;
+import com.github.tomakehurst.wiremock.junit5.WireMockExtension;
+import com.github.tomakehurst.wiremock.matching.UrlPathPattern;
+import com.google.common.collect.Lists;
import org.apache.commons.io.FileUtils;
import org.apache.maven.buildcache.its.junit.IntegrationTest;
import org.apache.maven.it.VerificationException;
@@ -49,61 +48,57 @@
/**
* Verifies MBUILDCACHE-25 - build cache calculated and saved exactly once in presence of forked executions
*/
-@IntegrationTest( "src/test/projects/forked-executions-core-extension-remote" )
-public class ForkedExecutionsTest
-{
+@IntegrationTest("src/test/projects/forked-executions-core-extension-remote")
+public class ForkedExecutionsTest {
private static final String PROJECT_NAME = "org.apache.maven.caching.test.simple:forked-executions-core-extension";
@RegisterExtension
static WireMockExtension wm = WireMockExtension.newInstance()
- .options( wireMockConfig().dynamicPort().notifier( new ConsoleNotifier( true ) ) )
+ .options(wireMockConfig().dynamicPort().notifier(new ConsoleNotifier(true)))
.build();
private Path tempDirectory;
@BeforeEach
- void setUp() throws IOException
- {
- tempDirectory = Files.createTempDirectory( "build-cache-test-" );
+ void setUp() throws IOException {
+ tempDirectory = Files.createTempDirectory("build-cache-test-");
}
@AfterEach
- void tearDown() throws IOException
- {
- FileUtils.deleteDirectory( tempDirectory.toFile() );
+ void tearDown() throws IOException {
+ FileUtils.deleteDirectory(tempDirectory.toFile());
}
@Test
- void testForkedExecution( Verifier verifier ) throws VerificationException
- {
+ void testForkedExecution(Verifier verifier) throws VerificationException {
- UrlPathPattern buildInfoPath = urlPathMatching( ".*/buildinfo.xml" );
- wm.stubFor( get( buildInfoPath ).willReturn( notFound() ) );
- wm.stubFor( put( buildInfoPath ).willReturn( ok() ) );
+ UrlPathPattern buildInfoPath = urlPathMatching(".*/buildinfo.xml");
+ wm.stubFor(get(buildInfoPath).willReturn(notFound()));
+ wm.stubFor(put(buildInfoPath).willReturn(ok()));
- UrlPathPattern jarPath = urlPathMatching( ".*/forked-executions-core-extension-remote.jar" );
- wm.stubFor( put( jarPath ).willReturn( ok() ) );
+ UrlPathPattern jarPath = urlPathMatching(".*/forked-executions-core-extension-remote.jar");
+ wm.stubFor(put(jarPath).willReturn(ok()));
- UrlPathPattern cacheReportPath = urlPathMatching( ".*/build-cache-report.xml" );
- wm.stubFor( put( cacheReportPath ).willReturn( ok() ) );
+ UrlPathPattern cacheReportPath = urlPathMatching(".*/build-cache-report.xml");
+ wm.stubFor(put(cacheReportPath).willReturn(ok()));
- verifier.setAutoclean( false );
+ verifier.setAutoclean(false);
- verifier.setLogFileName( "../log-1.txt" );
- verifier.setMavenDebug( true );
- verifier.setCliOptions(
- Lists.newArrayList( "-Dmaven.build.cache.location=" + tempDirectory.toAbsolutePath(),
- "-Dmaven.build.cache.remoteUrl=http:////localhost:" + wm.getRuntimeInfo().getHttpPort(),
- "-Dmaven.build.cache.remote.save.enabled=true" ) );
- verifier.executeGoal( "verify" );
- verifier.verifyTextInLog( "Started forked project" );
- verifier.verifyTextInLog( "BUILD SUCCESS" );
+ verifier.setLogFileName("../log-1.txt");
+ verifier.setMavenDebug(true);
+ verifier.setCliOptions(Lists.newArrayList(
+ "-Dmaven.build.cache.location=" + tempDirectory.toAbsolutePath(),
+ "-Dmaven.build.cache.remoteUrl=http:////localhost:"
+ + wm.getRuntimeInfo().getHttpPort(),
+ "-Dmaven.build.cache.remote.save.enabled=true"));
+ verifier.executeGoal("verify");
+ verifier.verifyTextInLog("Started forked project");
+ verifier.verifyTextInLog("BUILD SUCCESS");
- wm.verify( exactly( 1 ), getRequestedFor( buildInfoPath ) );
- wm.verify( exactly( 1 ), putRequestedFor( buildInfoPath ) );
- wm.verify( exactly( 1 ), putRequestedFor( jarPath ) );
- wm.verify( exactly( 1 ), putRequestedFor( cacheReportPath ) );
+ wm.verify(exactly(1), getRequestedFor(buildInfoPath));
+ wm.verify(exactly(1), putRequestedFor(buildInfoPath));
+ wm.verify(exactly(1), putRequestedFor(jarPath));
+ wm.verify(exactly(1), putRequestedFor(cacheReportPath));
}
-
}