SpinGo / op-rabbit

The Opinionated RabbitMQ Library for Scala and Akka
Other
232 stars 73 forks source link

Suggestion: change Message and all composed classes from class to case class #169

Open Woodz opened 5 years ago

Woodz commented 5 years ago

Currently, Message is a final class with public fields that extends from Function1. This causes problems with logging and testing as easy visualisation and comparison is not possible. For example, Message.toString returns <function1> and message1 shouldBe message2 returns assertion failed: expected <function1>, found <function1>. By changing Message and all contained classes (e.g. PublisherImpl and DefiningPublisher) to case classes, toString and equals will automatically be provided, which will make the API easier to debug and test