import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import net.pterodactylus.sone.core.event.InsertionDelayChangedEvent;
}
@Test
+ public void noEventIsSentWhenInvalidInsertionDelayIsSet() {
+ try {
+ preferences.setInsertionDelay(-15);
+ } catch (IllegalArgumentException iae) {
+ /* ignore. */
+ }
+ verify(eventBus, never()).post(any());
+ }
+
+ @Test
public void preferencesReturnDefaultValueWhenInsertionDelayIsSetToNull() {
preferences.setInsertionDelay(null);
assertThat(preferences.getInsertionDelay(), is(60));