diff --git a/src/test/java/com/google/devtools/build/lib/remote/RemoteSpawnCacheTest.java b/src/test/java/com/google/devtools/build/lib/remote/RemoteSpawnCacheTest.java index 4171d01fe5b763..61ce8de1bd9734 100644 --- a/src/test/java/com/google/devtools/build/lib/remote/RemoteSpawnCacheTest.java +++ b/src/test/java/com/google/devtools/build/lib/remote/RemoteSpawnCacheTest.java @@ -143,7 +143,7 @@ public MetadataProvider getMetadataProvider() { @Override public ArtifactExpander getArtifactExpander() { - throw new UnsupportedOperationException(); + return SIMPLE_ARTIFACT_EXPANDER; } @Override diff --git a/src/test/java/com/google/devtools/build/lib/remote/RemoteSpawnRunnerTest.java b/src/test/java/com/google/devtools/build/lib/remote/RemoteSpawnRunnerTest.java index 68fce99846b68b..81bbc05a481c43 100644 --- a/src/test/java/com/google/devtools/build/lib/remote/RemoteSpawnRunnerTest.java +++ b/src/test/java/com/google/devtools/build/lib/remote/RemoteSpawnRunnerTest.java @@ -74,6 +74,7 @@ import com.google.devtools.build.lib.exec.RemoteLocalFallbackRegistry; import com.google.devtools.build.lib.exec.SpawnCheckingCacheEvent; import com.google.devtools.build.lib.exec.SpawnExecutingEvent; +import com.google.devtools.build.lib.exec.SpawnInputExpander; import com.google.devtools.build.lib.exec.SpawnRunner; import com.google.devtools.build.lib.exec.SpawnRunner.SpawnExecutionContext; import com.google.devtools.build.lib.exec.SpawnSchedulingEvent; @@ -1267,6 +1268,7 @@ public void shouldReportCheckingCacheBeforeScheduling() throws Exception { Spawn spawn = newSimpleSpawn(); SpawnExecutionContext policy = mock(SpawnExecutionContext.class); + when(policy.getSpawnInputExpander()).thenReturn(mock(SpawnInputExpander.class)); when(policy.getTimeout()).thenReturn(Duration.ZERO); when(executor.executeRemotely( @@ -1310,6 +1312,7 @@ public void shouldReportExecutingStatusWithoutMetadata() throws Exception { Spawn spawn = newSimpleSpawn(); SpawnExecutionContext policy = mock(SpawnExecutionContext.class); + when(policy.getSpawnInputExpander()).thenReturn(mock(SpawnInputExpander.class)); when(policy.getTimeout()).thenReturn(Duration.ZERO); when(executor.executeRemotely( @@ -1353,6 +1356,7 @@ public void shouldReportExecutingStatusAfterGotExecutingStageFromMetadata() thro Spawn spawn = newSimpleSpawn(); SpawnExecutionContext policy = mock(SpawnExecutionContext.class); + when(policy.getSpawnInputExpander()).thenReturn(mock(SpawnInputExpander.class)); when(policy.getTimeout()).thenReturn(Duration.ZERO); when(executor.executeRemotely( @@ -1413,6 +1417,7 @@ public void shouldIgnoreInvalidMetadata() throws Exception { Spawn spawn = newSimpleSpawn(); SpawnExecutionContext policy = mock(SpawnExecutionContext.class); + when(policy.getSpawnInputExpander()).thenReturn(mock(SpawnInputExpander.class)); when(policy.getTimeout()).thenReturn(Duration.ZERO); when(executor.executeRemotely( @@ -1461,6 +1466,7 @@ public void shouldReportExecutingStatusIfNoExecutingStatusFromMetadata() throws Spawn spawn = newSimpleSpawn(); SpawnExecutionContext policy = mock(SpawnExecutionContext.class); + when(policy.getSpawnInputExpander()).thenReturn(mock(SpawnInputExpander.class)); when(policy.getTimeout()).thenReturn(Duration.ZERO); when(executor.executeRemotely( @@ -1510,6 +1516,7 @@ public void shouldReportExecutingStatusEvenNoOperationFromServer() throws Except Spawn spawn = newSimpleSpawn(); SpawnExecutionContext policy = mock(SpawnExecutionContext.class); + when(policy.getSpawnInputExpander()).thenReturn(mock(SpawnInputExpander.class)); when(policy.getTimeout()).thenReturn(Duration.ZERO); when(executor.executeRemotely(