@Test public void shouldLoadAllRowsForTableFromJsonFile() throws Exception { // given final InputStream input = getClass().getClassLoader().getResourceAsStream("one-table.json"); // when JsonDataSet jsonDataSet = new JsonDataSet(input); // then TableAssert.assertThat(jsonDataSet.getTable("useraccount")).hasRows(2); }
@Test public void shouldLoadAllColumnsForTableFromJsonFile() throws Exception { // given final InputStream input = getClass().getClassLoader().getResourceAsStream("one-table.json"); // when JsonDataSet jsonDataSet = new JsonDataSet(input); // then TableAssert.assertThat(jsonDataSet.getTable("useraccount")) .hasColumns("id", "firstname", "lastname", "username", "password", "email"); }
@Test public void shouldLoadAllRowsWithContentForTableFromJsonFile() throws Exception { // given final InputStream input = getClass().getClassLoader().getResourceAsStream("one-table.json"); // when JsonDataSet jsonDataSet = new JsonDataSet(input); // then TableAssert.assertThat(jsonDataSet.getTable("useraccount")) .hasRow( "id: 1", "firstname: John", "lastname: Smith", "username: doovde", "password: password") .hasRow( "id: 2", "firstname: Clark", "lastname: Kent", "username: superman", "password: kryptonite", "email: [email protected]"); }