@Test public void getParameterNamesInterfaceNoAnnotation() { assertThat( discoverer.getParameterNames(ReflectionUtils.findMethod(Dao.class, "findMessageByIdNoAnnotation", String.class))).isNull(); }
@Test public void getParameterNamesClassNoAnnotation() { assertThat( discoverer.getParameterNames(ReflectionUtils.findMethod(Dao.class, "findMessageByIdNoAnnotation", String.class))).isNull(); }
@Test public void getParameterNamesConstructorNoAnnotation() throws Exception { assertThat(discoverer.getParameterNames(Impl.class.getConstructor(Long.class))) .isNull(); }
@Test public void constructorEmptyMapNullDefault() { assertThat(new InMemoryConfiguration( Collections.<String, AppConfigurationEntry[]>emptyMap(), null) .getAppConfigurationEntry("name")).isNull(); }
@Test public void toByteArray_null_returnsNull() { byte[][] array = null; assertThat(toByteArray(array)).isNull(); }
@Test public void constructorEmptyMap() { assertThat(new InMemoryConfiguration( Collections.<String, AppConfigurationEntry[]>emptyMap()) .getAppConfigurationEntry("name")).isNull(); }
@Test public void getFirst_empty_returnsNull() { Object[] emptyArray = new Object[0]; assertThat((Object[]) getFirst(emptyArray)).isNull(); }
@Test public void toBytes_null_returnsNull() { Byte[][] byteArray = null; assertThat(toBytes(byteArray)).isNull(); }
@Test public void getParameterNamesClassAnnotationOnBaseClass() throws Exception { assertThat( discoverer.getParameterNames(ReflectionUtils.findMethod(Dao.class, "findMessageByIdNoAnnotation", String.class))).isNull(); assertThat( discoverer.getParameterNames(ReflectionUtils.findMethod(DaoImpl.class, "findMessageByIdNoAnnotation", String.class))).isEqualTo( new String[] { "id" }); }
assertThat(report.issues[0].primaryLocation.textRange.endColumn).isEqualTo(4); assertThat(report.issues[0].primaryLocation.textRange.endLine).isEqualTo(3); assertThat(report.issues[0].secondaryLocations).isNull();
@Test public void constructorNullDefault() { assertThat(new InMemoryConfiguration((AppConfigurationEntry[]) null) .getAppConfigurationEntry("name")).isNull(); }
@Test public void resolveFieldPathDoesntMatch() throws Exception { assertThat(Options.resolveFieldPath("a.b", set("c", "d"))).isNull(); }
@Test public void testNullArray() { ao.insertUuidArray(null); assertThat(ao.fetchUuidArray()).isNull(); }
@Test public void valuesNotSetTest() { DiskBackupStatusImpl status = new DiskBackupStatusImpl(); assertThat(status.getBackedUpDiskStores()).isNull(); assertThat(status.getOfflineDiskStores()).isNull(); }
@Test public void testKnownUserEmptyInbox() throws Exception { finishSetUp(pop3Configuration); pop3Client = new POP3Client(); InetSocketAddress bindedAddress = new ProtocolServerUtils(pop3Server).retrieveBindedAddress(); pop3Client.connect(bindedAddress.getAddress().getHostAddress(), bindedAddress.getPort()); usersRepository.addUser("foo", "bar"); // not authenticated POP3MessageInfo[] entries = pop3Client.listMessages(); assertThat(entries).isNull(); pop3Client.login("foo", "bar"); System.err.println(pop3Client.getState()); assertThat(pop3Client.getState()).isEqualTo(1); entries = pop3Client.listMessages(); assertThat(pop3Client.getState()).isEqualTo(1); assertThat(entries).isNotNull(); assertThat(0).isEqualTo(entries.length); POP3MessageInfo p3i = pop3Client.listMessage(1); assertThat(pop3Client.getState()).isEqualTo(1); assertThat(p3i).isNull(); }
/** * @see DATAGRAPH-594 */ @Test public void shouldPreserveAAfterReflectRemovalOtherA() { session.save(a1); session.save(a2); session.save(a3); session.save(a4); // it is our responsibility to keep the domain entities synchronized a2.a = null; session.save(a2); //when we reload a2 loadedA2 = session.load(A.class, a2.id); // expect its relationships have gone. assertThat(loadedA2.a).isNull(); // when we reload a1 loadedA1 = session.load(A.class, a1.id); // expect the original relationships to remain intact. assertThat(loadedA1.a).containsExactlyInAnyOrder(a2, a3); // when we reload a3 loadedA3 = session.load(A.class, a3.id); // expect the original relationships to remain intact. assertThat(loadedA3.a).containsExactlyInAnyOrder(a2, a4); //when we reload a4 loadedA4 = session.load(A.class, a4.id); //expect the original relationships to remain intact. assertThat(loadedA4.a).isNull(); }
@Test public void dispatchShouldNotAlterOriginalMessageWhenPerRecipientHeaderDoesNotExist() throws Exception { AccumulatorHeaderMailStore accumulatorTestHeaderMailStore = new AccumulatorHeaderMailStore(TEST_HEADER_NAME); MailDispatcher testee = MailDispatcher.builder() .mailetContext(fakeMailContext) .mailStore(accumulatorTestHeaderMailStore) .consume(false) .build(); FakeMail mail = FakeMail.builder() .sender(MailAddressFixture.OTHER_AT_JAMES) .recipients(MailAddressFixture.ANY_AT_JAMES, MailAddressFixture.ANY_AT_JAMES2) .mimeMessage(MimeMessageUtil.defaultMimeMessage()) .state("state") .build(); mail.addSpecificHeaderForRecipient(TEST_HEADER_USER1, MailAddressFixture.ANY_AT_JAMES); mail.addSpecificHeaderForRecipient(TEST_HEADER_USER2, MailAddressFixture.ANY_AT_JAMES2); testee.dispatch(mail); assertThat(mail.getMessage().getHeader(TEST_HEADER_NAME)).isNull(); }