PlanService { public Plan addPlan(Plan plan) { return planRepository.save(plan); } @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 testAddPlan() { when(planRepository.save(plan)).thenReturn(plan); assertEquals(plan, planService.addPlan(plan)); }
@Test public void testInvalidAddPlan() { assertEquals(null, planService.addPlan(plan2)); }