Create EnrollingServiceTest class in src/test/java in the same package as EnrollingService
class EnrollingServiceTest {
private EnrollingService enrollingService;
@Before
public void init() {
enrollingService = new EnrollingService();
}
@Test
public void testEnroll() {
boolean result = enrollingService.enroll(1l, 1l);
assertTrue(result);
...
IDE (I am assuming you are using IDE) shows errors – EnrollingService does not exists .
Point cursor on EnrollService – IDE will offer to create a class – let it create in src/main/java
Now IDE says that enroll(long, long) method is missing – let IDE create it for you.
Now IDE shows no errors. Run the test – it fails. Go to enroll and start implementing the logic
And so on…