Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes Data type mismatch issue on LeaderBoard #349

Closed
wants to merge 7 commits into from
Closed

Fixes Data type mismatch issue on LeaderBoard #349

wants to merge 7 commits into from

Conversation

padmano
Copy link

@padmano padmano commented Oct 1, 2019

@padmano
Copy link
Author

padmano commented Oct 1, 2019

@Brutus5000 Can you help me out with this ?

@Brutus5000
Copy link
Member

@iamTheL If you rebase on develop it will be fixed.
That's a nasty circular dependency in our release process.

public GlobalLeaderboardEntry getGlobalEntry(int playerId) {
return globalLeaderboardRepository.findByPlayerId(playerId);
public GlobalLeaderboardEntry getGlobalEntry(String playerId) {
if(DataTypeValidation.isNumeric(playerId))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe with Brackets. I actually just read your guidelines and I can not find anything on that but we like to keep code style alike.

Copy link
Author

@padmano padmano Oct 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have added the brackets for the if-else block. Still it seems to be failing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is failing?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not able to find out what is causing the test coverage to drop.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well if u add more lines without writing tests the coverage increases so if u write new stuff(like u did) test it. Make a unit test feed the Service a string and see if it throws the Exception u expected...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Will write tests and submit again.

1-alex98
1-alex98 previously approved these changes Oct 2, 2019
@1-alex98
Copy link
Member

1-alex98 commented Oct 2, 2019

your suggested fix does not work.(tested it)

This should also be way more compact.

if(!StringUtils.isNumeric(playerId)){
      throw new ApiException(new Error(ErrorCode.PLAYER_ID_MUST_BE_NUMBER));
}

And use StringUtils from Apache that is it basically.

Padmanabhan Manoharan added 2 commits October 3, 2019 10:11
@padmano
Copy link
Author

padmano commented Oct 3, 2019

@axel1200 I went ahead with your suggestion.

1-alex98
1-alex98 previously approved these changes Oct 3, 2019
Copy link
Member

@1-alex98 1-alex98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am sorry to annoy you further but this would be a something that can be easily tested, either unit or integration test. Does not really matter.

@Brutus5000
Copy link
Member

Got superseeded by #372 as we replaced the whole exception.

@Brutus5000 Brutus5000 closed this Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants