Junior — Middle
What third-party libraries or tools did you use when creating automated tests?
sobes.tech AI
Answer from AI
When creating automated tests in Java, the following third-party libraries and tools are often used:
- JUnit — a basic framework for writing unit tests.
- TestNG — an alternative to JUnit with extended capabilities.
- Mockito — for creating mock objects and simulating dependency behavior.
- Selenium WebDriver — for automating web interface testing.
- AssertJ — for convenient and readable assertions.
- Cucumber — for writing BDD tests in a language close to natural language.
Example of using Mockito:
import static org.mockito.Mockito.*;
List<String> mockedList = mock(List.class);
when(mockedList.get(0)).thenReturn("Hello");
System.out.println(mockedList.get(0)); // Will output "Hello"