use of org.robobinding.PendingAttributesForView in project RoboBinding by RoboBinding.
the class BindingAttributeResolverTest method givenTwoCandidateResolvers_whenResolveCompletedAtFirstResolver_thenSecondResolverShouldBeSkipped.
@Test
public void givenTwoCandidateResolvers_whenResolveCompletedAtFirstResolver_thenSecondResolverShouldBeSkipped() {
ByBindingAttributeMappingsResolver candidateResolver1 = mock(ByBindingAttributeMappingsResolver.class);
ByBindingAttributeMappingsResolver candidateResolver2 = mock(ByBindingAttributeMappingsResolver.class);
when(byBindingAttributeMappingsResolverFinder.findCandidates(any(View.class))).thenReturn(newArrayList(candidateResolver1, candidateResolver2));
BindingAttributeResolver bindingAttributeResolver = new BindingAttributeResolver(byBindingAttributeMappingsResolverFinder);
PendingAttributesForView pendingAttributesForView = mock(PendingAttributesForView.class);
when(pendingAttributesForView.isEmpty()).thenReturn(true);
bindingAttributeResolver.resolve(pendingAttributesForView);
verify(candidateResolver1).resolve(pendingAttributesForView);
verify(candidateResolver2, never()).resolve(pendingAttributesForView);
}
Aggregations