GeoPointMapWidget extends QuestionWidget implements BinaryDataReceiver { @Override public void setOnLongClickListener(OnLongClickListener l) { binding.simpleButton.setOnLongClickListener(l); binding.geoAnswerText.setOnLongClickListener(l); } GeoPointMapWidget(Context context, QuestionDetails questionDetails,
                             QuestionDef questionDef, WaitingForDataRegistry waitingForDataRegistry); @Override IAnswerData getAnswer(); @Override void clearAnswer(); @Override void setOnLongClickListener(OnLongClickListener l); @Override void cancelLongPress(); @Override void setBinaryData(Object answer); static final String LOCATION; static final String ACCURACY_THRESHOLD; static final String READ_ONLY; static final String DRAGGABLE_ONLY; static final double DEFAULT_LOCATION_ACCURACY; }
@Test public void clickingButtonForLong_callsLongClickListener() { View.OnLongClickListener listener = mock(View.OnLongClickListener.class); GeoPointMapWidget widget = createWidget(promptWithAnswer(null)); widget.setOnLongClickListener(listener); widget.binding.simpleButton.performLongClick(); verify(listener).onLongClick(widget.binding.simpleButton); }