@Test public void shouldHaveToStringMethod() { String msg = table.toString(); assertThat(msg).isNotNull(); assertThat(msg).isNotEmpty(); }
@Test public void shouldReturnVersion() { assertThat(Module.version()).isNotNull(); assertThat(Module.version()).isNotEmpty(); }
assertThat(name).startsWith("column."); assertThat(name).endsWith(".chars"); assertThat(value).isNotNull(); }); assertThat(counter.get()).isEqualTo(6);
private void validateFieldDef(Field expected) { ConfigDef configDef = connector.config(); assertThat(configDef.names()).contains(expected.name()); ConfigDef.ConfigKey key = configDef.configKeys().get(expected.name()); assertThat(key).isNotNull(); assertThat(key.name).isEqualTo(expected.name()); assertThat(key.displayName).isEqualTo(expected.displayName()); assertThat(key.importance).isEqualTo(expected.importance()); assertThat(key.documentation).isEqualTo(expected.description()); assertThat(key.type).isEqualTo(expected.type()); assertThat(key.defaultValue).isEqualTo(expected.defaultValue()); assertThat(key.dependents).isEqualTo(expected.dependents()); assertThat(key.width).isNotNull(); assertThat(key.group).isNotNull(); assertThat(key.orderInGroup).isGreaterThan(0); assertThat(key.validator).isNull(); assertThat(key.recommender).isNull(); } }
protected static void assertConfigDefIsValid(Connector connector, io.debezium.config.Field.Set fields) { ConfigDef configDef = connector.config(); assertThat(configDef).isNotNull(); fields.forEach(expected -> { assertThat(configDef.names()).contains(expected.name()); ConfigKey key = configDef.configKeys().get(expected.name()); assertThat(key).isNotNull(); assertThat(key.name).isEqualTo(expected.name()); assertThat(key.displayName).isEqualTo(expected.displayName()); assertThat(key.importance).isEqualTo(expected.importance()); assertThat(key.documentation).isEqualTo(expected.description()); assertThat(key.type).isEqualTo(expected.type()); if (expected.equals(MySqlConnectorConfig.DATABASE_HISTORY) || expected.equals(MySqlConnectorConfig.JDBC_DRIVER)) { assertThat(((Class<?>) key.defaultValue).getName()).isEqualTo((String) expected.defaultValue()); } else if (!expected.equals(MySqlConnectorConfig.SERVER_ID)) { assertThat(key.defaultValue).isEqualTo(expected.defaultValue()); } assertThat(key.dependents).isEqualTo(expected.dependents()); assertThat(key.width).isNotNull(); assertThat(key.group).isNotNull(); assertThat(key.orderInGroup).isGreaterThan(0); assertThat(key.validator).isNull(); assertThat(key.recommender).isNull(); }); } }
protected static void assertConfigDefIsValid(Connector connector, io.debezium.config.Field.Set fields) { ConfigDef configDef = connector.config(); assertThat(configDef).isNotNull(); fields.forEach(expected -> { assertThat(configDef.names()).contains(expected.name()); ConfigKey key = configDef.configKeys().get(expected.name()); assertThat(key).isNotNull(); assertThat(key.name).isEqualTo(expected.name()); assertThat(key.displayName).isEqualTo(expected.displayName()); assertThat(key.importance).isEqualTo(expected.importance()); assertThat(key.documentation).isEqualTo(expected.description()); assertThat(key.type).isEqualTo(expected.type()); assertThat(key.defaultValue).isEqualTo(expected.defaultValue()); assertThat(key.dependents).isEqualTo(expected.dependents()); assertThat(key.width).isNotNull(); assertThat(key.group).isNotNull(); assertThat(key.orderInGroup).isGreaterThan(0); assertThat(key.validator).isNull(); assertThat(key.recommender).isNull(); }); }
@Test public void testGetBoardMemberActivityComments() { List<CardWithActions> commentActivity = trello.getBoardMemberActivity(BOARD_ID, "5187a69eabd0b7305100beaa", "commentCard"); assertThat(commentActivity).isNotNull(); assertThat(commentActivity).hasSize(1); assertThat(commentActivity.get(0).getActions()).isNotNull(); assertThat(commentActivity.get(0).getActions()).hasSize(1); assertThat(commentActivity.get(0).getActions().get(0)).isNotNull(); assertThat(commentActivity.get(0).getActions().get(0).getData()).isNotNull(); assertThat(commentActivity.get(0).getActions().get(0).getData().getText()).isNotNull(); assertThat(commentActivity.get(0).getActions().get(0).getData().getText()) .isEqualToIgnoringCase("a comment"); } }
@Ignore @Test public void testGetEntityManager() throws ClassNotFoundException, InstantiationException, IllegalAccessException, SQLException { final EntityManager em = CoreFactory.getEntityManager(); assertThat(((EntityManagerImpl) em).getConnectionUserName()).isNotNull().isEmpty(); assertThat(((EntityManagerImpl) em).getConnectionPassword()).isNotNull().isEmpty(); assertThat(((EntityManagerImpl) em).getConnection()).isNotNull(); CoreFactory.shutdown(); assertThat(CoreFactory.getQueries()).isEmpty(); }
@Test public void constructorShouldSetTitle() { book = new Book(TITLE); assertThat(book.getTitle()).isNotNull(); assertThat(book.getTitle()).isNotEmpty(); assertThat(book.getTitle()).isEqualTo(TITLE); }
@Test public void shouldRegisterPayback() { PaybackConfirmation confirmation = bookKeeper.registerPaybackFor(purchase); assertThat(confirmation.getNumber()).isNotNull(); assertThat(confirmation.getIncome().getAmount()).isEqualTo(Money.of(EUR, 6L)); assertThat(confirmation.getIncome().getDistributions()).hasSize(2); assertThat(confirmation.getIncome().getDistribution("Glock").getAmount()).isEqualTo(Money.of(EUR, 3L)); assertThat(confirmation.getIncome().getDistribution("M60").getAmount()).isEqualTo(Money.of(EUR, 3L)); } }
@Test public void shouldRegisterPayback() { PaybackConfirmation confirmation = bookKeeper.registerPaybackFor(purchase); assertThat(confirmation.getNumber()).isNotNull(); assertThat(confirmation.getIncome().getAmount()).isEqualTo(Money.of(EUR, 6L)); assertThat(confirmation.getIncome().getDistributions()).hasSize(2); assertThat(confirmation.getIncome().getDistribution("Glock").getAmount()).isEqualTo(Money.of(EUR, 3L)); assertThat(confirmation.getIncome().getDistribution("M60").getAmount()).isEqualTo(Money.of(EUR, 3L)); } }
@Test public void shouldRegisterPayback() { PaybackConfirmation confirmation = bookKeeper.registerPaybackFor(purchase); assertThat(confirmation.getNumber()).isNotNull(); assertThat(confirmation.getIncome().getAmount()).isEqualTo(Money.of(EUR, 6L)); assertThat(confirmation.getIncome().getDistributions()).hasSize(2); assertThat(confirmation.getIncome().getDistribution("Glock").getAmount()).isEqualTo(Money.of(EUR, 3L)); assertThat(confirmation.getIncome().getDistribution("M60").getAmount()).isEqualTo(Money.of(EUR, 3L)); } }
@Test public void shouldRegisterPayback() { PaybackConfirmation confirmation = bookKeeper.registerPaybackFor(purchase); assertThat(confirmation.getNumber()).isNotNull(); assertThat(confirmation.getIncome().getAmount()).isEqualTo(Money.of(EUR, 6L)); assertThat(confirmation.getIncome().getDistributions()).hasSize(2); assertThat(confirmation.getIncome().getDistribution("Glock").getAmount()).isEqualTo(Money.of(EUR, 3L)); assertThat(confirmation.getIncome().getDistribution("M60").getAmount()).isEqualTo(Money.of(EUR, 3L)); } }
@Test public void shouldRegisterPayback() { PaybackConfirmation confirmation = bookKeeper.registerPaybackFor(purchase); assertThat(confirmation.getNumber()).isNotNull(); assertThat(confirmation.getIncome().getAmount()).isEqualTo(Money.of(EUR, 6L)); assertThat(confirmation.getIncome().getDistributions()).hasSize(2); assertThat(confirmation.getIncome().getDistribution("Glock").getAmount()).isEqualTo(Money.of(EUR, 3L)); assertThat(confirmation.getIncome().getDistribution("M60").getAmount()).isEqualTo(Money.of(EUR, 3L)); } }
@Test public void shouldRegisterPayback() { PaybackConfirmation confirmation = bookKeeper.registerPaybackFor(purchase()); assertThat(confirmation.getNumber()).isNotNull(); assertThat(confirmation.getIncome().getAmount()).isEqualTo(Money.of(EUR, 6L)); assertThat(confirmation.getIncome().getDistributions()).hasSize(2); assertThat(confirmation.getIncome().getDistribution("Glock").getAmount()).isEqualTo(Money.of(EUR, 3L)); assertThat(confirmation.getIncome().getDistribution("M60").getAmount()).isEqualTo(Money.of(EUR, 3L)); } }
@Test public void shouldRegisterPayback() { PaybackConfirmation confirmation = bookKeeper.registerPaybackFor(purchase); assertThat(confirmation.getNumber()).isNotNull(); assertThat(confirmation.getIncome().getAmount()).isEqualTo(Money.of(EUR, 6L)); assertThat(confirmation.getIncome().getDistributions()).hasSize(2); assertThat(confirmation.getIncome().getDistribution("Glock").getAmount()).isEqualTo(Money.of(EUR, 3L)); assertThat(confirmation.getIncome().getDistribution("M60").getAmount()).isEqualTo(Money.of(EUR, 3L)); } }
@Test public void shouldRegisterPayback() { PaybackConfirmation confirmation = bookKeeper.registerPaybackFor(purchase()); assertThat(confirmation.getNumber()).isNotNull(); assertThat(confirmation.getIncome().getAmount()).isEqualTo(Money.of(EUR, 6L)); assertThat(confirmation.getIncome().getDistributions()).hasSize(2); assertThat(confirmation.getIncome().getDistribution("Glock").getAmount()).isEqualTo(Money.of(EUR, 3L)); assertThat(confirmation.getIncome().getDistribution("M60").getAmount()).isEqualTo(Money.of(EUR, 3L)); } }
@Test public void shouldRegisterPayback() { PaybackConfirmation confirmation = bookKeeper.registerPaybackFor(purchase()); assertThat(confirmation.getNumber()).isNotNull(); assertThat(confirmation.getIncome().getAmount()).isEqualTo(Money.of(EUR, 6L)); assertThat(confirmation.getIncome().getDistributions()).hasSize(2); assertThat(confirmation.getIncome().getDistribution("Glock").getAmount()).isEqualTo(Money.of(EUR, 3L)); assertThat(confirmation.getIncome().getDistribution("M60").getAmount()).isEqualTo(Money.of(EUR, 3L)); } }
@Test public void shouldRegisterPayback() { PaybackConfirmation confirmation = bookKeeper.registerPaybackFor(purchase()); assertThat(confirmation.getNumber()).isNotNull(); assertThat(confirmation.getIncome().getAmount()).isEqualTo(Money.of(EUR, 6L)); assertThat(confirmation.getIncome().getDistributions()).hasSize(2); assertThat(confirmation.getIncome().getDistribution("Glock").getAmount()).isEqualTo(Money.of(EUR, 3L)); assertThat(confirmation.getIncome().getDistribution("M60").getAmount()).isEqualTo(Money.of(EUR, 3L)); } }
@Test public void shouldRegisterPayback() { PaybackConfirmation confirmation = bookKeeper.registerPaybackFor(purchase()); assertThat(confirmation.getNumber()).isNotNull(); assertThat(confirmation.getIncome().getAmount()).isEqualTo(Money.of(EUR, 6L)); assertThat(confirmation.getIncome().getDistributions()).hasSize(2); assertThat(confirmation.getIncome().getDistribution("Glock").getAmount()).isEqualTo(Money.of(EUR, 3L)); assertThat(confirmation.getIncome().getDistribution("M60").getAmount()).isEqualTo(Money.of(EUR, 3L)); } }