How do I assert that two HashMap with Javabean values are equal?

后端 未结 8 1291
一整个雨季
一整个雨季 2021-02-13 18:45

I have two HashMap maps that I would like to compare. Question in this case is a Javabean I have written.

How do I ass

8条回答
  •  南笙
    南笙 (楼主)
    2021-02-13 19:35

    Too compare maps ,in your particular case :

    1)Check the size of the map if its equal

    Then use

        `assertTrue(expectedMap.equals(hashMap));` 
    

    In your Question bean you have to override the equals and hashcode method.

提交回复
热议问题