use of org.assertj.core.api.SoftAssertions in project wh-app-android by WhiteHouse.
the class DataTest method listOfFeedItemEqualsFeedItem.
@Test
public void listOfFeedItemEqualsFeedItem() {
SoftAssertions softly = new SoftAssertions();
FeedItem item = generateFeedItem();
FeedItem dupe = generateFeedItem();
List<FeedItem> list1 = new ArrayList<>(1);
List<FeedItem> list2 = new ArrayList<>(1);
list1.add(item);
list2.add(item);
softly.assertThat(list1).hasSameElementsAs(list2);
softly.assertThat(list1).isEqualTo(list2);
list2.clear();
list2.add(dupe);
softly.assertThat(list1).hasSameElementsAs(list2);
softly.assertThat(list1).isEqualTo(list2);
softly.assertAll();
}
use of org.assertj.core.api.SoftAssertions in project geode by apache.
the class DataCommandFunctionWithPDXJUnitTest method testTableIsRectangular.
// GEODE-2662: building a table where early values are missing keys causes the data to shift
// upward during reporting.
@Test
public void testTableIsRectangular() throws GfJsonException {
TabularResultData rawTable = getTableFromQuery("select * from /" + PARTITIONED_REGION);
// Verify any table built
assertThat(rawTable.getGfJsonObject()).isNotNull();
assertThat(rawTable.getGfJsonObject().getJSONObject("content")).isNotNull();
GfJsonObject tableJson = rawTable.getGfJsonObject().getJSONObject("content");
// Verify table is rectangular
SoftAssertions softly = new SoftAssertions();
for (String k : new String[] { "id", "phone", "firstName", "lastName" }) {
softly.assertThat(tableJson.getJSONArray(k).size()).isEqualTo(4);
}
softly.assertAll();
}
use of org.assertj.core.api.SoftAssertions in project spring-data-jdbc by spring-projects.
the class JdbcEntityTemplateIntegrationTests method saveAndLoadAnEntityWithReferencedEntityById.
// DATAJDBC-112
@Test
public void saveAndLoadAnEntityWithReferencedEntityById() {
template.save(legoSet, LegoSet.class);
assertThat(legoSet.manual.id).describedAs("id of stored manual").isNotNull();
LegoSet reloadedLegoSet = template.findById(legoSet.getId(), LegoSet.class);
assertThat(reloadedLegoSet.manual).isNotNull();
SoftAssertions softly = new SoftAssertions();
//
softly.assertThat(reloadedLegoSet.manual.getId()).isEqualTo(//
legoSet.getManual().getId()).isNotNull();
softly.assertThat(reloadedLegoSet.manual.getContent()).isEqualTo(legoSet.getManual().getContent());
softly.assertAll();
}
use of org.assertj.core.api.SoftAssertions in project spring-data-jdbc by spring-projects.
the class JdbcEntityTemplateIntegrationTests method saveAndDeleteAllWithReferencedEntity.
// DATAJDBC-112
@Test
public void saveAndDeleteAllWithReferencedEntity() {
template.save(legoSet, LegoSet.class);
template.deleteAll(LegoSet.class);
SoftAssertions softly = new SoftAssertions();
assertThat(template.findAll(LegoSet.class)).isEmpty();
assertThat(template.findAll(Manual.class)).isEmpty();
softly.assertAll();
}
use of org.assertj.core.api.SoftAssertions in project spring-data-jdbc by spring-projects.
the class SqlGeneratorFixedNamingStrategyUnitTests method findOneWithOverriddenFixedTableName.
// DATAJDBC-107
@Test
public void findOneWithOverriddenFixedTableName() {
SqlGenerator sqlGenerator = configureSqlGenerator(fixedCustomTablePrefixStrategy);
String sql = sqlGenerator.getFindOne();
SoftAssertions softAssertions = new SoftAssertions();
//
softAssertions.assertThat(sql).startsWith(//
"SELECT").contains(//
"FixedCustomSchema.FixedCustomTablePrefix_DummyEntity.FixedCustomPropertyPrefix_id AS FixedCustomPropertyPrefix_id,").contains(//
"FixedCustomSchema.FixedCustomTablePrefix_DummyEntity.FixedCustomPropertyPrefix_name AS FixedCustomPropertyPrefix_name,").contains(//
"ref.FixedCustomPropertyPrefix_l1id AS ref_FixedCustomPropertyPrefix_l1id").contains(//
"ref.FixedCustomPropertyPrefix_content AS ref_FixedCustomPropertyPrefix_content").contains("FROM FixedCustomSchema.FixedCustomTablePrefix_DummyEntity");
softAssertions.assertAll();
}
Aggregations