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

AYS-659 | Refactor error code from 404 to 409 when trying to activate an already active user #434

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

idilalemdar
Copy link
Contributor

@idilalemdar idilalemdar commented Jan 21, 2025

…ve user

Checklist

Before submitting your pull request, ensure the following:

  • Title and Branch Naming Conventions:

  • Local Testing:

    • I have tested my changes locally on Postman, and they are working as expected.
  • Code Quality:

    • The code is formatted according to the project's coding guidelines and style.
    • The code has been reviewed to ensure its quality.
    • The code does not contain any issues flagged by SonarLint.
  • Documentation:

    • Necessary documentation has been added or existing documentation has been updated, specifically detailing changes made in Postman.
  • Testing:

    • Relevant unit tests have been written and included.
    • Relevant integration tests have been written and included.
  • Reviewers and Assignees:

    • Default reviewers have been assigned to this pull request.
    • Assignees have been added if necessary.
  • Labels and Associations:

    • No specific actions are required in the Labels and Associations section for this pull request.

@idilalemdar idilalemdar changed the title refactor: make error code 409 when trying to activate an already acti… AYS-659 | Refactor error code from 404 to 409 when trying to activate an already active user Jan 21, 2025
@yusufkaya01
Copy link
Contributor

@idilalemdar Yanlışlıkla benden review talep edildiğini düşünüyorum. DevOps tarafı ile ilgili bir konu varsa bakabilirim.

@idilalemdar idilalemdar removed the request for review from yusufkaya01 January 21, 2025 19:16
@idilalemdar
Copy link
Contributor Author

@idilalemdar Yanlışlıkla benden review talep edildiğini düşünüyorum. DevOps tarafı ile ilgili bir konu varsa bakabilirim.

yok hayır senlik bir durum yok, dediğin gibi yanlışlıkla eklemişim, çok özür dilerim.

@@ -118,7 +117,7 @@ public void activate(String id) {
.orElseThrow(() -> new AysUserNotExistByIdException(id));

if (!user.isPassive()) {
throw new AysUserNotPassiveException(AysUserStatus.PASSIVE);
throw new AysUserNotPassiveException();
Copy link
Collaborator

@agitrubard agitrubard Jan 22, 2025

Choose a reason for hiding this comment

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

Burada 2 kontrol olması gerekiyor;

  • Kullanıcının zaten aktif olduğunu belirtmek için bir kontrol ekleyip, aktif olduğunu belirtmek
  • Kullanıcının pasif olmadığına dair bir kontrol ekleyip, pasif olmadığını söylemek

Ek olarak hem unit test'leri hem de bu case'i test eden bir end to end test yazıp hata mesajını ve http status code'unu doğrulayabilir miyiz?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okey şu an !user.isPassiver()'e ek olarak user.isActive() kontrolü var. bunların ilgili unit testleri de var. end-to -end test ne için tam olarak anlayamadım onu. @agitrubard

Copy link
Contributor

@egehanasal egehanasal left a comment

Choose a reason for hiding this comment

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

@agitrubard 'in bahsettigi end to end test atlanmis sanirim
@idilalemdar

Copy link
Collaborator

@agitrubard agitrubard left a comment

Choose a reason for hiding this comment

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

Unit Testlere ek olarak 2 senaryo için end-to-end test eklememiz ve response'ta ilgili cevapları doğrulamamız iyi olabilir

Copy link
Collaborator

@agitrubard agitrubard left a comment

Choose a reason for hiding this comment

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

End-to-End testleri ekledikten sonra mergeleyebiliriz 👍🏼

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