Refine search
@Test public void testFieldDefault() throws Exception { MultiValueMap<String, String> formData = new LinkedMultiValueMap<>(); formData.add("!postProcessed", "off"); formData.add("postProcessed", "on"); this.binder.bind(exchange(formData)).block(Duration.ofMillis(5000)); assertTrue(this.testBean.isPostProcessed()); formData.remove("postProcessed"); this.binder.bind(exchange(formData)).block(Duration.ofMillis(5000)); assertFalse(this.testBean.isPostProcessed()); }
@Test public void testFieldPrefixCausesFieldReset() throws Exception { MultiValueMap<String, String> formData = new LinkedMultiValueMap<>(); formData.add("_postProcessed", "visible"); formData.add("postProcessed", "on"); this.binder.bind(exchange(formData)).block(Duration.ofMillis(5000)); assertTrue(this.testBean.isPostProcessed()); formData.remove("postProcessed"); this.binder.bind(exchange(formData)).block(Duration.ofMillis(5000)); assertFalse(this.testBean.isPostProcessed()); }
@Test public void testFieldPrefixCausesFieldResetWithIgnoreUnknownFields() throws Exception { this.binder.setIgnoreUnknownFields(false); MultiValueMap<String, String> formData = new LinkedMultiValueMap<>(); formData.add("_postProcessed", "visible"); formData.add("postProcessed", "on"); this.binder.bind(exchange(formData)).block(Duration.ofMillis(5000)); assertTrue(this.testBean.isPostProcessed()); formData.remove("postProcessed"); this.binder.bind(exchange(formData)).block(Duration.ofMillis(5000)); assertFalse(this.testBean.isPostProcessed()); }
@Test public void sourceIsOpen() throws Exception { BufferedSource source = Okio.buffer((Source) new Buffer()); assertTrue(source.isOpen()); source.close(); assertFalse(source.isOpen()); }
@Test public void sinkIsOpen() throws Exception { BufferedSink sink = Okio.buffer((Sink) new Buffer()); assertTrue(sink.isOpen()); sink.close(); assertFalse(sink.isOpen()); }
@Test public void testRemoveObjectNotAdded() { boolean removed = modelList.remove(new TestModel()); assertFalse(removed); verifyNoMoreInteractions(observer); }
@Test public void canArchive() throws Exception { when(adapter.getSelected()).thenReturn(asList(habit1, habit2)); assertFalse(behavior.canArchive()); when(adapter.getSelected()).thenReturn(asList(habit2, habit3)); assertTrue(behavior.canArchive()); }
@Test public void canEdit() throws Exception { when(adapter.getSelected()).thenReturn(singletonList(habit1)); assertTrue(behavior.canEdit()); when(adapter.getSelected()).thenReturn(asList(habit1, habit2)); assertFalse(behavior.canEdit()); }
@Test public void canUnarchive() throws Exception { when(adapter.getSelected()).thenReturn(asList(habit1, habit2)); assertFalse(behavior.canUnarchive()); when(adapter.getSelected()).thenReturn(singletonList(habit1)); assertTrue(behavior.canUnarchive()); }
@Test public void testFieldDefaultPreemptsFieldMarker() throws Exception { MultiValueMap<String, String> formData = new LinkedMultiValueMap<>(); formData.add("!postProcessed", "on"); formData.add("_postProcessed", "visible"); formData.add("postProcessed", "on"); this.binder.bind(exchange(formData)).block(Duration.ofMillis(5000)); assertTrue(this.testBean.isPostProcessed()); formData.remove("postProcessed"); this.binder.bind(exchange(formData)).block(Duration.ofMillis(5000)); assertTrue(this.testBean.isPostProcessed()); formData.remove("!postProcessed"); this.binder.bind(exchange(formData)).block(Duration.ofMillis(5000)); assertFalse(this.testBean.isPostProcessed()); }
@Test public void onArchiveHabits() throws Exception { assertFalse(habit2.isArchived()); when(adapter.getSelected()).thenReturn(singletonList(habit2)); behavior.onArchiveHabits(); assertTrue(habit2.isArchived()); }
@Test public void onUnarchiveHabits() throws Exception { assertTrue(habit1.isArchived()); when(adapter.getSelected()).thenReturn(singletonList(habit1)); behavior.onUnarchiveHabits(); assertFalse(habit1.isArchived()); }
@Test public void shouldBeAbleToAnswerIfPluginSupportsPasswordBasedAuthentication() throws Exception { assertTrue(store.doesPluginSupportPasswordBasedAuthentication("password.plugin-2")); assertFalse(store.doesPluginSupportPasswordBasedAuthentication("web.plugin-1")); }
@Test public void shouldNotErrorWhenTargetVersionInResponse() { String json = "{\n" + " \"target_version\" : 1,\n" + " \"pipelines\" : [],\n" + " \"errors\" : []\n" + "}"; makeMigratorReturnSameJSON(); CRParseResult result = handler.responseMessageForParseDirectory(json); assertFalse(result.hasErrors()); }
@Test public void testNetVersion() throws Exception { NetVersion netVersion = web3j.netVersion().send(); assertFalse(netVersion.getNetVersion().isEmpty()); }
@Test public void testEthProtocolVersion() throws Exception { EthProtocolVersion ethProtocolVersion = web3j.ethProtocolVersion().send(); assertFalse(ethProtocolVersion.getProtocolVersion().isEmpty()); }
@Test public void testStreamHandle() { FakeStream stream = new FakeStream(); JsonParser parser = JsonParser.newParser(stream); List<JsonEvent> events = new ArrayList<>(); parser.handler(events::add); stream.handle("{}"); assertFalse(stream.isPaused()); assertEquals(2, events.size()); }
@Test public void shouldShow() throws Exception { when(prefs.getLastHintTimestamp()).thenReturn(today); assertFalse(hintList.shouldShow()); when(prefs.getLastHintTimestamp()).thenReturn(yesterday); assertTrue(hintList.shouldShow()); } }
@Test public void testOnToggleShowArchived() { behavior.onToggleShowArchived(); verify(adapter).setFilter(matcherCaptor.capture()); assertTrue(matcherCaptor.getValue().isArchivedAllowed()); clearInvocations(adapter); behavior.onToggleShowArchived(); verify(adapter).setFilter(matcherCaptor.capture()); assertFalse(matcherCaptor.getValue().isArchivedAllowed()); }
@Test public void testOnToggleShowCompleted() { behavior.onToggleShowCompleted(); verify(adapter).setFilter(matcherCaptor.capture()); assertTrue(matcherCaptor.getValue().isCompletedAllowed()); clearInvocations(adapter); behavior.onToggleShowCompleted(); verify(adapter).setFilter(matcherCaptor.capture()); assertFalse(matcherCaptor.getValue().isCompletedAllowed()); }