PlanService { public boolean deletePlan(int id) { planRepository.delete(id); return true; } @Autowired  PlanService(PlanRepository myPlanRepository);  PlanService(); List<Plan> getPlansById(Integer id); Plan getPlansByPlaceId(Integer id); Plan addPlan(Plan plan); boolean deletePlan(int id); void setRepository(PlanRepository repository);  }
@Test public void testDeletePlan() { when(planRepository.save(plan)).thenReturn(plan); assertEquals(true, planService.deletePlan(1)); }