Closed tsantalis closed 9 months ago
clients/src/test/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinatorTest.java
clients/src/test/java/org/apache/kafka/common/record/DefaultRecordBatchTest.java
for (Record record: batch) {
record.isValid();
}
batch.forEach(Record::isValid)
Fixed after c579b49451d85539b33d8f24e04c788277def049. Annotations were also fixed after f7f8cd2992338a59239143df4007bd7e5f4d4920. @tsantalis
@tsantalis @victorgveloso
This case can be further improved by mapping the expected
value inside the @test
annotation with the first argument of the assertThrows()
.
If the existing implementation results in an Annotation Added refactoring, my implementation at https://github.com/tsantalis/RefactoringMiner/pull/225 would do that.
That looks for matching type literals between the value in @Test(expected=) MemberValuePair and the first assertThrows parameter.
However, @tsantalis claimed to add a native detection for assertThrows which should be more precise than my implementation and may address this particular problem @pouryafard75 spotted.
@pouryafard75
I fixed the matching of the expected
value inside the annotation with the first argument of the assertThrows()
but I don't get the method reference name matched.
Was this feature in one of the recent PRs?
Replicated at https://github.com/pouryafard75/TestCases/commit/562c4447a566170ac28872a88b323669a82db5c9 to enhance the testability.
https://github.com/apache/kafka/commit/913a019d6c9b03eb44706deb7fb164f79c1f601f#diff-8be2ce40c210584b1895e2dcec0949876b8da1b65fa3a8e3ebf80123f4e5efb3
clients/src/test/java/org/apache/kafka/common/record/ByteBufferLogInputStreamTest.java
@pouryafard75 Is it possible to support this kind of match?
logInputStream.nextBatch()
->logInputStream::nextBatch