Skip to content

Commit 5f9bf8b

Browse files
Pubsub test client fixup (#25907)
* make incoming message public * add set clock method to test client * spotless
1 parent 6cb7b8e commit 5f9bf8b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubTestClient.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,11 @@ private static class State {
100100
private static final State STATE = new State();
101101

102102
/** Closing the factory will validate all expected messages were processed. */
103-
public interface PubsubTestClientFactory extends PubsubClientFactory, Closeable, Serializable {}
103+
public interface PubsubTestClientFactory extends PubsubClientFactory, Closeable, Serializable {
104+
default <T> PubsubIO.Read<T> setClock(PubsubIO.Read<T> readTransform, Clock clock) {
105+
return readTransform.withClock(clock);
106+
}
107+
}
104108

105109
/**
106110
* Return a factory for testing publishers. Only one factory may be in-flight at a time. The

0 commit comments

Comments
 (0)