Skip to content

Commit

Permalink
remove nested try for element order assert
Browse files Browse the repository at this point in the history
  • Loading branch information
seglo committed Jul 16, 2017
1 parent b77be17 commit 13d1617
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -242,7 +242,7 @@ effort to support.
# Resources

* Kafka Improvement Proposals (KIP) for Transaction Support
* [KIP-98 - Exactly Once Delivery and Transactional Messaging](https://cwiki.apache.org/confluence/display/KAFKA/KIP-98+-+Exactly+Once+Delivery+and+Transactional+Messaging)
* [KIP-98: Exactly Once Delivery and Transactional Messaging](https://cwiki.apache.org/confluence/display/KAFKA/KIP-98+-+Exactly+Once+Delivery+and+Transactional+Messaging)
* [KIP-129: Streams Exactly-Once Semantics](https://cwiki.apache.org/confluence/display/KAFKA/KIP-129%3A+Streams+Exactly-Once+Semantics)
* [You Cannot Have Exactly-Once Delivery](http://bravenewgeek.com/you-cannot-have-exactly-once-delivery/)
* [You Cannot Have Exactly-Once Delivery Redux](http://bravenewgeek.com/you-cannot-have-exactly-once-delivery-redux/)
Expand Down
18 changes: 8 additions & 10 deletions src/main/scala/seglo/apps/AssertSinkTopic.scala
Expand Up @@ -79,16 +79,14 @@ object AssertSinkTopic extends App {
} :+
(partition, "END", "END_TRANSFORM")

Try {
/**
* Asserts that the generated expected records occur in order in the actual records. Because Kafka only
* guarantees message order within a partition we can only assert order per partition. ScalaTest has a nice
* collections matcher to help here.
*
* http://doc.scalatest.org/3.0.0/index.html#org.scalatest.Matchers@inOrderElementsOf[R](elements:scala.collection.GenTraversable[R]):org.scalatest.words.ResultOfInOrderElementsOfApplication
*/
records should contain inOrderElementsOf expectedPartitionRecords
}
/**
* Asserts that the generated expected records occur in order in the actual records. Because Kafka only
* guarantees message order within a partition we can only assert order per partition. ScalaTest has a nice
* collections matcher to help here.
*
* http://doc.scalatest.org/3.0.0/index.html#org.scalatest.Matchers@inOrderElementsOf[R](elements:scala.collection.GenTraversable[R]):org.scalatest.words.ResultOfInOrderElementsOfApplication
*/
records should contain inOrderElementsOf expectedPartitionRecords
}
}.isSuccess
}
Expand Down

0 comments on commit 13d1617

Please sign in to comment.