I solved my problem by creating a CheckBoxSelectionMatcher (Thanks to
Dovile):
public class CheckBoxSelectionMatcher extends
TypeSafeMatcher<JCheckBox> {
private final boolean shouldBeSelected;
public CheckBoxSelectionMatcher(final boolean expectedState) {
shouldBeSelected = expectedState;
}
public boolean matchesSafely(final JCheckBox item) {
return item.isSelected() == shouldBeSelected;
}
@Override
public void describeTo(final Description description) {
description.appendText("selected");
}
public static CheckBoxSelectionMatcher withSelectState(boolean
state) {
return new CheckBoxSelectionMatcher(state);
}
}
and performing the test:
table.hasRow(IterableComponentsMatcher.matching(withSelectState(group.isSelected()),
withLabelText(group.getName()),
withLabelText(group.getDescription())));
thanks
Niels