Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add assertions to compare a table with another or a request to another #35

Open
regis1512 opened this issue Apr 6, 2016 · 2 comments
Open

Comments

@regis1512
Copy link
Member

regis1512 commented Apr 6, 2016

The idea is to have an assertion like :

assertThat(table).isEqualTo(anotherTable);

@JustAlexOne
Copy link

Upvoting. Would be really good to have the same for Request as well

@tisoft
Copy link

tisoft commented Mar 31, 2021

Would also really like that.

Currently I'm converting the tables into list of maps as a workaround:

      List <Map <String, Object>> expected = vmUserTable.getRowsList ()
                                                        .stream ()
                                                        .map (row -> row.getValuesList ()
                                                                        .stream ()
                                                                        .filter (v -> v.getValue () != null)
                                                                        .collect (Collectors.toMap (Value::getColumnName, Value::getValue)))
                                                        .collect (Collectors.toList ());
      List <Map <String, Object>> actual = dynUserTable.getRowsList ()
                                                       .stream ()
                                                       .map (row -> row.getValuesList ()
                                                                       .stream ()
                                                                       .filter (v -> v.getValue () != null)
                                                                       .collect (Collectors.toMap (Value::getColumnName, Value::getValue)))
                                                       .collect (Collectors.toList ());
      assertThat (actual).isEqualTo (expected);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants