use of org.zaproxy.zap.extension.users.UsersTableModel in project zaproxy by zaproxy.
the class UsersTableModelUnitTest method shouldHaveJustThreeColumns.
@Test
void shouldHaveJustThreeColumns() {
// Given
UsersTableModel usersTableModel = new UsersTableModel();
// When / Then
assertThat(usersTableModel.getColumnCount(), is(equalTo(3)));
assertThat(usersTableModel.getColumnName(0), is(notNullValue()));
assertThat(usersTableModel.getColumnName(1), is(notNullValue()));
assertThat(usersTableModel.getColumnName(2), is(notNullValue()));
}
use of org.zaproxy.zap.extension.users.UsersTableModel in project zaproxy by zaproxy.
the class UsersTableModelUnitTest method shouldFailToModifyNonExistingElement.
@Test
void shouldFailToModifyNonExistingElement() {
// Given
List<User> usersList = new ArrayList<>();
usersList.add(createEnabledUser());
UsersTableModel usersTableModel = new UsersTableModel(usersList);
// When / Then
assertThrows(IndexOutOfBoundsException.class, () -> usersTableModel.modifyElement(1, createUser()));
}
use of org.zaproxy.zap.extension.users.UsersTableModel in project zaproxy by zaproxy.
the class UsersTableModelUnitTest method shouldAddTableModelListeners.
@Test
void shouldAddTableModelListeners() {
// Given
TableModelListener listener = createTestTableModelListener();
UsersTableModel usersTableModel = new UsersTableModel();
// When
usersTableModel.addTableModelListener(listener);
// Then
assertThat(usersTableModel.getTableModelListeners(), is(arrayContaining(listener)));
}
use of org.zaproxy.zap.extension.users.UsersTableModel in project zaproxy by zaproxy.
the class UsersTableModelUnitTest method shouldFailToGetNonExistingElement.
@Test
void shouldFailToGetNonExistingElement() {
// Given
UsersTableModel usersTableModel = new UsersTableModel();
// When / Then
assertThrows(IndexOutOfBoundsException.class, () -> usersTableModel.getElement(1));
}
use of org.zaproxy.zap.extension.users.UsersTableModel in project zaproxy by zaproxy.
the class UsersTableModelUnitTest method shouldReturnNullValueAndColumnClassForNonExistingColumns.
@Test
void shouldReturnNullValueAndColumnClassForNonExistingColumns() {
// Given
List<User> usersList = new ArrayList<>();
usersList.add(createUser());
// When
UsersTableModel usersTableModel = new UsersTableModel(usersList);
// Then
assertThat(usersTableModel.getColumnClass(3), is(equalTo(null)));
assertThat(usersTableModel.getValueAt(0, 3), is(equalTo(null)));
}
Aggregations