JujaLabs / itevents

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

#48-otp #157

Closed IgorMaksymov closed 8 years ago

IgorMaksymov commented 8 years ago

generation of OTP and user activation added connect to #48

witjem commented 8 years ago

You have to fix merge conflict

IgorMaksymov commented 8 years ago

@roma-ilnitsky @romach fixed, review pls

witjem commented 8 years ago

@IgorMaksymov generateOtpByUserIdAndSendItToUserEmail() you have to divided this method because it do not match SOLID.

I offer:

 @Override
    public void addSubscriber(String username, String password) throws Exception {
        User user = UserBuilder.anUser()
                .login(username)
                .role(roleService.getRoleByName("guest"))
                .build();
        addUser(user, passwordEncoder.encode(password));

        OneTimePassword otp = oneTimePassword.generateOtp(otpLifetime);
        registerOtp(otp);
        sendOtpToUserEmail(otp);
    }
IgorMaksymov commented 8 years ago

@roma-ilnitsky updated, review pls

witjem commented 8 years ago
vaa25 commented 8 years ago

@IgorMaksymov Failed merge from master. Previous issues in master deleted.

IgorMaksymov commented 8 years ago

@vaa25 what?This branch has no conflicts with the base branch and Travis check passed. Check your database. in some cases there may so much changes from diffent Changesets, so it becomes incompatible with other braches. To avoid this we need to do rollback before every checkout.

vaa25 commented 8 years ago

@IgorMaksymov I checkouted another 48 branch. Why we have three of them?

IgorMaksymov commented 8 years ago

@vaa25 because we need all of them. IgorMaksymov wants to merge 16 commits into master from #48-otp

vaa25 commented 8 years ago

@IgorMaksymov why we need all of them? Maybe you need its locally?

IgorMaksymov commented 8 years ago

@vaa25 not locally, we need it to share code with partner

vaa25 commented 8 years ago

@IgorMaksymov has ignored tests @AndriyBaibak 15 min

IgorMaksymov commented 8 years ago

@ i opened tasks to fix them. i'm out of scope here.

vaa25 commented 8 years ago

@IgorMaksymov UserService: setOtpToUser is used only in UserService. getUserByOtp is not used anywhewe It seems task is not finished. What is target of this task? No tests, no demos... How to check it? What to check? Only code style?

IgorMaksymov commented 8 years ago

@vaa25 i dont understand purpose of your comment, it's to criticize me or something else?

which of setOtpToUser? i should make it private or add ot to UserDao.addSubscriber ? what is not tested? demo is after merge.

vaa25 commented 8 years ago

@IgorMaksymov yes, task seems finished except: UserService:

  1. why getUserByOtp is separate method in UserService?
  2. activateUserWithOtp has broken indents

OtpExpiredServiceExceprion:

  1. has unused constructor
  2. has mistake in the name

MyBatisUserServiceTest:

  1. What doing verify in shouldNotUseOtpIfExpired?
  2. Magic number in shouldUseOtpAndSetRoleToSubscriber

UserRestControllerTest:

  1. shouldActivateUserByOtp has incorrect path

ControllerHandlerTest:

  1. no test for expired otp

OneTimePasswordTest:

  1. Magic number
  2. Why you don't use bean OneTimePassword in tests?

And of course ignored tests of changed methods @AndriyBaibak 1.5 hours

Garazd commented 8 years ago

@AndriyBaibak 2 hours

vaa25 commented 8 years ago
IgorMaksymov commented 8 years ago

@AndriyBaibak time spent: 1h