@Test
public void testSelectPattern() throws Exception {

    page.selectPattern(pattern);
    verify(view).setAvailableFields(availableFieldsCaptor.capture());
    List<AvailableField> availableFields = availableFieldsCaptor.getValue();
    assertEquals(4,
                 availableFields.size());
    assertTrue(availableFields.stream()
                       .allMatch(field ->
                                         field.getCalculationType() == BaseSingleFieldConstraint.TYPE_LITERAL &&
                                                 ((field.getName().compareTo("this") == 0 &&
                                                         field.getType().compareTo(DataType.TYPE_THIS) == 0) ||
                                                         (field.getName().compareTo("street") == 0 &&
                                                                 field.getType().compareTo(String.class.getSimpleName()) == 0) ||
                                                         (field.getName().compareTo("homeAddress") == 0 &&
                                                                 field.getType().compareTo(Boolean.class.getSimpleName()) == 0) ||
                                                         (field.getName().compareTo("number") == 0 &&
                                                                 field.getType().compareTo(Integer.class.getSimpleName()) == 0))
                       )
    );
    verify(view).setChosenConditions(conditions);
}