expectedDiagnostics.size()
);
while ( actualIterator.hasNext() ) {
DiagnosticDescriptor actual = actualIterator.next();
DiagnosticDescriptor expected = expectedIterator.next();
if ( expected.getSourceFileName() != null ) {
assertThat( actual.getSourceFileName() ).isEqualTo( expected.getSourceFileName() );
}
if ( expected.getLine() != null ) {
assertThat( actual.getLine() ).isEqualTo( expected.getLine() );
}
assertThat( actual.getKind() ).isEqualTo( expected.getKind() );
assertThat( actual.getMessage() ).describedAs(
String.format(
"Unexpected message for diagnostic %s:%s %s",
actual.getSourceFileName(),
actual.getLine(),
actual.getKind()
)
).matches( ".*" + expected.getMessage() + ".*" );
}
}