I have a Message
object with MessageHeaders
field. The MessageHeaders
class implements a Map<String, Object>
. I want to assert that I have specific headers set. I'm having trouble getting the MapAssert
methods to come up.
Here's what I want to accomplish:
assertThat(actual)
.extracting(Message::getHeaders) // This returns AbstractObjectAssert though
.containsKeys("some key"); // Not available
Here's the Message
and MessageHeaders
class to be clear:
public class Message {
private MessageHeaders headers;
// getter
}
public class MessageHeaders implements Map<String, Object>, Serializable {
// methods
}
asInstanceOf()
was introduced inAssertJ Core 3.13.0 Release
. I will have to update. – Overkill