Automation Rhapsody

Posts with tag: JUnit

Testing with Cypress - Custom logging of errors and JUnit results

Description of the custom error logger and also custom JUnit XML file creator.

Mock new object creation with PowerMock

How to control what objects are being instantiated when using PowerMock.

Mock private method call with PowerMock

How to mock private method with PowerMock by using spy object.

Call private method with PowerMock

How to invoke a private method with PowerMock.

Soft assertions that do not fail JUnit test

Code examples how to use assertions that do not fail the unit test immediately.

Verify static method was called with PowerMock

How to verify that static method was called during a unit test with PowerMock.

Data driven testing with JUnit and Gradle

How to do data-driven testing with JUnit and Gradle.

Mutation testing for Java with PITest

Introduction to mutation testing and examples with PITest tool for Java.

Mock/Stub REST API with WireMock for better unit testing

Examples how to use WireMock to stub (mock also is possible as a term) REST API in order make better unit testing.

Mock static methods in JUnit with PowerMock example

Examples how to mock static methods in JUnit tests with PowerMock.

Data driven testing with JUnit parameterized tests

How to do data-driven testing with JUnit parameterized tests.

Assert Mockito mock method arguments if no equals() method implemented

How to assert mock method is called with the specific object as an argument in case no equals() method is implemented on argument object.

Mock JUnit tests with Mockito example

Why mocking is needed in unit testing and how to do it with Mockito.

JUnit methods execution sequence

Details with code samples on JUnit methods execution sequence.

Retry JUnit failed tests immediately

How to retry failed JUnit tests immediately and if a retry is OK then report test as passed.

Use JUnit rules to debug failed API tests

What are JUnit rules and how to use them to improve debugging of failed API tests.