コード例 #1
0
  @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);
  }
コード例 #2
0
  @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");
  }
コード例 #3
0
  @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]");
  }