Mock Object

A controlled stand-in used to verify how code interacts with a dependency.

What is Mock Object in Java?

Mock Object — A controlled stand-in used to verify how code interacts with a dependency.

interface Clock {
    int hour();
}

class MorningTest {
    Clock fakeClock = () -> 9;
}

Level: Freelancer · More Java terms at this level

Updated

In other subjects