### Question:
ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> void push(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject != null) { if (aspect.isValuePresent()) { callSetter(aspect); } else { invoke(aspect); } } } ReflectionPropertyDispatcher(Supplier<?> boundObjectSupplier, String property,
            PropertyDispatcher fallbackDispatcher); @Override String getProperty(); @CheckForNull @Override Object getBoundObject(); @Override Class<?> getValueClass(); @Override @SuppressWarnings("unchecked") V pull(Aspect<V> aspect); @Override void push(Aspect<V> aspect); @Override boolean isPushable(Aspect<V> aspect); @Override MessageList getMessages(MessageList messageList); @Override String toString();  }### Answer:
@Test public void testPush_Static() { TestModelObject spyObject = spy(new TestModelObject()); ReflectionPropertyDispatcher dispatcher = new ReflectionPropertyDispatcher(() -> spyObject, TestModelObject.PROPERTY_ABC, new ExceptionPropertyDispatcher(TestModelObject.PROPERTY_ABC)); dispatcher.push(Aspect.of("", "something")); verify(spyObject).setAbc(Mockito.eq("something")); }
@Test public void testPush_Static_PmoWithoutReadMethod() { PropertyDispatcher mockedDispatcher = noActionInPushMockedDispatcher(); ReflectionPropertyDispatcher dispatcher = new ReflectionPropertyDispatcher(this::getTestPmo, TestPMO.INVALID_PROPERTY_MISSING_GETTER_PMO, mockedDispatcher); dispatcher.push(Aspect.of("", "something")); verify(mockedDispatcher, times(1)).push(ArgumentMatchers.<Aspect<?>> any()); }
@Test public void testPush_Static_PmoWithoutWriteMethod() { ReflectionPropertyDispatcher dispatcher = new ReflectionPropertyDispatcher(this::getTestPmo, TestPMO.PROPERTY_PMO_GETTER_ONLY, noActionInPushMockedDispatcher()); Assertions.assertThrows(IllegalArgumentException.class, () -> { dispatcher.push(Aspect.of("", "something")); }); }
@Test public void testPush_Dynamic() { TestPMO spyPmo = spy(testPmo); ReflectionPropertyDispatcher dispatcher = new ReflectionPropertyDispatcher(() -> spyPmo, TestPMO.PROPERTY_BUTTON_CLICK, new ExceptionPropertyDispatcher(TestPMO.PROPERTY_BUTTON_CLICK)); dispatcher.push(Aspect.of("")); verify(spyPmo).buttonClick(); }
@Test public void testPush_Dynamic_NoBoundObject() { TestPMO spyPmo = spy(testPmo); ReflectionPropertyDispatcher dispatcher = new ReflectionPropertyDispatcher(() -> null, TestPMO.PROPERTY_BUTTON_CLICK, new ExceptionPropertyDispatcher(TestPMO.PROPERTY_BUTTON_CLICK)); dispatcher.push(Aspect.of("")); verify(spyPmo, never()).buttonClick(); }
@Test public void testPush_Dynamic_NoMethod() { TestPMO spyPmo = spy(testPmo); ReflectionPropertyDispatcher dispatcher = new ReflectionPropertyDispatcher(() -> spyPmo, TestPMO.PROPERTY_BUTTON_CLICK, new ExceptionPropertyDispatcher(TestPMO.PROPERTY_BUTTON_CLICK)); Assertions.assertThrows(IllegalArgumentException.class, () -> { dispatcher.push(Aspect.of("NoMethod")); }); }