@Test public void testScrollToBottom() { final DataTypeConstraintEnumerationItem item1 = mock(DataTypeConstraintEnumerationItem.class); final DataTypeConstraintEnumerationItem item2 = mock(DataTypeConstraintEnumerationItem.class); final DataTypeConstraintEnumerationItem item3 = mock(DataTypeConstraintEnumerationItem.class); doReturn(asList(item1, item2, item3)).when(constraintEnumeration).getEnumerationItems(); doNothing().when(constraintEnumeration).scrollToPosition(anyInt()); when(item1.getOrder()).thenReturn(1); when(item2.getOrder()).thenReturn(2); when(item3.getOrder()).thenReturn(3); constraintEnumeration.scrollToBottom(); verify(constraintEnumeration).scrollToPosition(3); }
void scrollToBottom() { getLastEnumerationItem().ifPresent(last -> scrollToPosition(last.getOrder())); }
DataTypeConstraintEnumeration implements DataTypeConstraintComponent { void scrollToBottom() { getLastEnumerationItem().ifPresent(last -> scrollToPosition(last.getOrder())); } }
DataTypeConstraintEnumeration implements DataTypeConstraintComponent { void scrollToBottom() { getLastEnumerationItem().ifPresent(last -> scrollToPosition(last.getOrder())); } @Inject  DataTypeConstraintEnumeration(final View view,
                                         final DMNClientServicesProxy clientServicesProxy,
                                         final ScrollHelper scrollHelper,
                                         final Event<DataTypeConstraintParserWarningEvent> parserWarningEvent,
                                         final ManagedInstance<DataTypeConstraintEnumerationItem> enumerationItemInstances); }
DataTypeConstraintEnumeration implements DataTypeConstraintComponent { void scrollToBottom() { getLastEnumerationItem().ifPresent(last -> scrollToPosition(last.getOrder())); } @Inject  DataTypeConstraintEnumeration(final View view,
                                         final DMNClientServicesProxy clientServicesProxy,
                                         final ScrollHelper scrollHelper,
                                         final Event<DataTypeConstraintParserWarningEvent> parserWarningEvent,
                                         final ManagedInstance<DataTypeConstraintEnumerationItem> enumerationItemInstances); @Override String getValue(); @Override void setValue(final String value); @Override void setConstraintValueType(final String type); void refreshView(); void refreshView(final Command onCompleteCallback); @Override Element getElement(); void render(); void scrollToPosition(final int position); List<DataTypeConstraintEnumerationItem> getEnumerationItems(); }
DataTypeConstraintEnumeration implements DataTypeConstraintComponent { void scrollToBottom() { getLastEnumerationItem().ifPresent(last -> scrollToPosition(last.getOrder())); } @Inject  DataTypeConstraintEnumeration(final View view,
                                         final DMNClientServicesProxy clientServicesProxy,
                                         final ScrollHelper scrollHelper,
                                         final Event<DataTypeConstraintParserWarningEvent> parserWarningEvent,
                                         final ManagedInstance<DataTypeConstraintEnumerationItem> enumerationItemInstances); @Override String getValue(); @Override void setValue(final String value); @Override void setConstraintValueType(final String type); void refreshView(); void refreshView(final Command onCompleteCallback); @Override Element getElement(); void render(); void scrollToPosition(final int position); List<DataTypeConstraintEnumerationItem> getEnumerationItems();  }