Cassandra java tests#7390
Conversation
| .hasAttributesSatisfying( | ||
| attributes -> | ||
| assertThat(attributes) | ||
| .containsEntry(NET_SOCK_PEER_ADDR, "127.0.0.1") | ||
| .containsEntry(NET_SOCK_PEER_NAME, "localhost") | ||
| .containsEntry(NET_SOCK_PEER_PORT, cassandraPort) | ||
| .containsEntry(DB_SYSTEM, "cassandra") | ||
| .containsEntry(DB_STATEMENT, "USE " + parameter.keyspace)) |
There was a problem hiding this comment.
can you change the assertions with fixed number of attributes to use hasAttributesSatisfyingExactly?
There was a problem hiding this comment.
In parameterized test some values are null and as a result attributes not exist, I didn't find a way for asserting optional parameters. Seems it is possible but it will be separate test, I mean, I should extract null values from params to new test. Is it OK ?
There was a problem hiding this comment.
.hasAttributesSatisfyingExactly(
equalTo(DB_CASSANDRA_TABLE, null)
)
It works, in this case dividing is not necessary
There was a problem hiding this comment.
@trask Could you check my changes, please?
trask
left a comment
There was a problem hiding this comment.
@aschugunov sorry for the late reply, and thanks for the help with the groovy -> Java conversion!
| equalTo(NET_SOCK_PEER_NAME, "localhost"), | ||
| equalTo(NET_SOCK_PEER_PORT, cassandraPort), | ||
| equalTo(DB_SYSTEM, "cassandra"), | ||
| equalTo(DB_NAME, null), |
There was a problem hiding this comment.
| equalTo(DB_NAME, null), |
| equalTo(DB_OPERATION, null), | ||
| equalTo(DB_CASSANDRA_TABLE, null))), |
There was a problem hiding this comment.
same, you can remove the null verifications b/c hasAttributesSatisyingExactly will fail if there are any extra attributes that you didn't verify
There was a problem hiding this comment.
Sure, thanks for the advice
c1e0a3a to
664b71d
Compare
|
It looks like build failed due to connectivity problem and rebuild will help. |
No description provided.