apache / apache/beam

[Question] Access to the PUBSUB unit test error

Open
#24,556 2 comments 0 reactions 0 assignees View on GitHub
java P3 question
Dominant language
Java
Stars
8.7k
Forks
4.7k
Avg merge
1d 20h
Merged PRs (30d)
196

Description

### What happened?

My scene is to access PUBSUB as data source
`
pipeline.apply("readpubsub", PubsubIO.readMessageWithMessageId().fromSubscription(sriptionid))...
`

Just as the unit test case is written, it is also injected into the Pubsubmessage object, but an error is reported
junit test code:
`
PubsubMessage pubsubMessage = Mockito.mock(PubsubMessage.class);
....
PCollection out = pipeline.apply("input", Create.of(pubsubMessage)).apply(....)
`

error: Unable to infer a coder and no Coder was specified.
I want to know how to set the coder about how to set the custom object pipeline

### Issue Failure

Failure: Test is flaky

### Issue Priority

Priority: 3

### Issue Component

Component: beam-community

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.