elvyssoares

DefaultAttributeMapTest - Refactored

May 19th, 2020
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.44 KB | None | 0 0
  1. @Test
  2. void testGetSetInt() {
  3.     final DefaultAttributeMap map = new DefaultAttributeMap(null);
  4.     final AttributeKey<Integer> key = AttributeKey.valueOf("int");
  5.  
  6.     assertThat(map.attr(key)).isNull();
  7.  
  8.     // Assigning random value to key
  9.     map.setAttr(key, 3653);
  10.     assertThat(map.attr(key)).isEqualTo(3653);
  11.  
  12.     // Replacing key value with a new random one
  13.     map.setAttr(key, 1);
  14.     assertThat(map.attr(key)).isEqualTo(1);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment