Task: Set up a self-contained Java project under /app that allows the provided Mockito-based JUnit tests to compile and run, and add a minimal production class to satisfy a typical project structure.
What you must implement
Create a Gradle-based Java project inside /app with a minimal production class and the given test class, so that the tests can be executed as-is and pass.
Use Mockito 1.x (matching the test’s MockitoJUnitRunner package) and JUnit 4.x as test dependencies.
Do not modify the provided test code; ensure it compiles and passes with the produced project structure.
/app/src/test/java/MockSpy.java (place the exact provided test code here)
Build configuration
Use Gradle (Gradle wrapper or local Gradle is acceptable; include a wrapper if possible).
Apply the Java plugin.
Set Java compatibility to at least Java 8 (sourceCompatibility = 1.8, targetCompatibility = 1.8).
Repositories: mavenCentral()
Dependencies
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:1.10.19' (to align with the test’s usage of org.mockito.runners.MockitoJUnitRunner)
No compile-time dependencies beyond the standard JDK for production code (the tests themselves pull Mockito in test scope)
Minimal production code
Create a tiny class at /app/src/main/java/com/example/MinimalService.java, for example:
public class MinimalService { public String echo(String s) { return s; } }
This is only to provide a simple, non-test production artifact and demonstrate a typical project layout.
How to run
From the repository root (where /app resides), run:
./gradlew test
Expect the provided MockSpy tests to compile and pass.
Notes
Do not modify the given MockSpy test code.
The task focuses on providing an actionable, self-contained project setup that enables the tests to pass and demonstrates proper project structure for tests using Mockito with JUnit.