JujaLabs / itevents

Resource to subscribe on it events
Apache License 2.0
7 stars 5 forks source link

186: EventRestController logic moved to EventService #204

Closed IgorMaksymov closed 8 years ago

IgorMaksymov commented 8 years ago

connect to #186

vaa25 commented 8 years ago

@IgorMaksymov

  1. MyBatisUserService.getUserByOtp(): broken intends
  2. MyBatisEventService.redirectToEventSite(): missed Override annotation
  3. ControllerHandlerTest.shouldNotAssignUserToEventIfAssigned(): has unused variable
  4. To be continued...
vaa25 commented 8 years ago

@IgorMaksymov

  1. Why do you have redundant rules for uncalled service methods and don't verify method calls in controller tests?
  2. The same is in: MyBatisUserServiceTest.shouldReturnUsersByEvent()
  3. MyBatisEventServiceTest.shouldAssignToEvent(): You should mock getFutureEvent() instead getEvent()
  4. MyBatisEventServiceTest.shouldUnassignUserFromEvent(): You should mock getFutureEvent() instead getEvent()
  5. Replace actual with returned anywhere in tests

P.S. Good work overall

@AndriyBaibak 30min

IgorMaksymov commented 8 years ago

@vaa25 4: What rules? 6: no, its failing without mocking getEvent. FutureEvent just checks date. I can mock them both, but this is redundant 7: idea was, to enable user unassign after event passed, so its correct to just getEvent(). fixed that in EventService

vaa25 commented 8 years ago

@IgorMaksymov

  1. when(...).thenReturn(...)
  2. yes, fails, because you shouldn't mock service itself at all. eventService is InjectMocks. eventDao is Mock.
IgorMaksymov commented 8 years ago

@vaa25 4: in sources its called Stubbing EventRestControllerTest refactored, review pls

vaa25 commented 8 years ago
romach commented 8 years ago

@IgorMaksymov you must merge assignAuthorizedUserToEvent() and assignUserToEvent() methods because assignUserToEvent isn't used anywhere else.

IgorMaksymov commented 8 years ago

@romach its private method of assignAuthorizedUserToEvent for more readability of code. @vaa25 do you agree, that this methods should be merged?

romach commented 8 years ago

@AndriyBaibak 30 minutes spent