[
https://issues.apache.org/jira/browse/KAFKA-7491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17519124#comment-17519124
]
Karsten Schnitter commented on KAFKA-7491:
------------------------------------------
Hi, this issue has not seen much action in quite some time. I am experiencing
the same issue. I tried patch-module in the pom.xml but to no avail:
{code:xml}
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>test-compile</id>
<phase>process-test-sources</phase>
<goals>
<goal>testCompile</goal>
</goals>
<configuration>
<compilerArgs>
<arg>--patch-module</arg>
<arg>kafka.streams=${settings.localRepository}/org/apache/kafka/kafka-streams-test-utils/3.0.1/kafka-streams-test-utils-3.0.1.jar</arg>
</compilerArgs>
</configuration>
</execution>
</executions>
</plugin>
{code}
That way, I got around the "missing symbol" issue, that is caused by the
test-util sitting in the same package on the classpath, where it is abandoned
due to the automatic kafka-streams module. But compilation still errors with an
incompatible type error for a TestRecord. The offending code in my project is:
{code:java}
private TestRecord<String, QuotaStatisticsMessage> readOutput() {
return outputTopic.readRecord();
}
{code}
The error message is:
{noformat}
incompatible types:
org.apache.kafka.streams.test.TestRecord<java.lang.String,com.sap.cf.hcp.logging.kafka.streams.quota.data.model.QuotaStatisticsFactory.QuotaStatisticsMessage>
cannot be converted to
org.apache.kafka.streams.test.TestRecord<java.lang.String,com.sap.cf.hcp.logging.kafka.streams.quota.data.model.QuotaStatisticsFactory.QuotaStatisticsMessage>
{noformat}
I cannot say for sure, if my own {{QuotaStatisticsMessage}} may cause the
problem, but I doubt it, since there are no failures at other places. I think,
the {{TestRecord}} might be incompatible, maybe due to the {{--patch-module}}.
Is there any idea, how to proceed. One way would be to release a second
test-util with different package names.
> Kafka streams and Kafka streams test utils have split packages
> --------------------------------------------------------------
>
> Key: KAFKA-7491
> URL: https://issues.apache.org/jira/browse/KAFKA-7491
> Project: Kafka
> Issue Type: Bug
> Components: streams
> Reporter: Robin Van Praet
> Priority: Major
>
> When trying to test a Kafka Streams application using JDK 9+, using the
> module path, (test) compilation errors occur.
> The TopologyTestDriver cannot be located in kafka-streams-test-utils because
> package 'org.apache.kafka.streams' is already provided by module
> kafka-streams.
> Please make sure that packages are not re-used between production libraries
> and test util libraries.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)