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

13 define entity seniormanageraccess #18

Closed
wants to merge 4 commits into from

Conversation

Koufan-De-King
Copy link
Contributor

@Koufan-De-King Koufan-De-King commented Sep 27, 2024

Created

  • seniormanageraccess class,
  • a repository for it's eventual connection to the database

and wrote a basic test using JUnit.

@NkwaTambe
Copy link
Contributor

Hello @Koufan-De-King please add a description to these pull request and fix the failling test

Comment on lines +30 to +34
// Constructor
public SeniorManagerAccess(String name, AccessStatus status) {
this.name = name;
this.status = status.ACTIVE;
}
Copy link
Contributor

@NkwaTambe NkwaTambe Sep 27, 2024

Choose a reason for hiding this comment

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

You're trying to access the ACTIVE value in the wrong way.

In your constructor, you're passing status as a parameter, and then you use status.ACTIVE. This confuses Java, because it thinks you're trying to get ACTIVE from the status parameter, which doesn't make sense.

The Fix:
Instead of using status.ACTIVE, you should directly use the enum name AccessStatus.ACTIVE to get the ACTIVE value.

The constructor sets this.status to AccessStatus.ACTIVE regardless of the input.
Correction: Change the constructor to accept the status parameter.(this.status=status)

Comment on lines +38 to +40

// Getters and Setters
//...
Copy link
Contributor

Choose a reason for hiding this comment

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

PLease remove these comment, it's not needed

Comment on lines +1 to +30
/*
* Copyright (c) 2018-2023 adorsys GmbH and Co. KG
* All rights are reserved.
*/

package de.adorsys.ledgers.baam.db.domain;

import org.junit.jupiter.api.Test;
class SeniorManagerAccessTest {

@Test
void createManagerRole() {
}

@Test
void modifyManagerRole() {
}

@Test
void revokeManagerRole() {
}

@Test
void suspendAccess() {
}

@Test
void activateAccess() {
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Hello @Koufan-De-King please implememt the various test cases ..

Also since the seniormanageraccess is an entity, it needs to be included into the ledgers DB..

to verify, executed docker compose up on the ledgers root directory to see..

}

// Default constructor for JPA
public SeniorManagerAccess() {}
Copy link
Contributor

Choose a reason for hiding this comment

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

perfect...

doing these will make more sense:

public SeniorManagerAccess() {
        this.status = AccessStatus.ACTIVE; // Set default status
    }```

Comment on lines +1 to +29
/*
* Copyright (c) 2018-2023 adorsys GmbH and Co. KG
* All rights are reserved.
*/

package de.adorsys.ledgers.baam.db.domain;

import org.junit.jupiter.api.Test;
class SeniorManagerAccessTest {

@Test
void createManagerRole() {
}

@Test
void modifyManagerRole() {
}

@Test
void revokeManagerRole() {
}

@Test
void suspendAccess() {
}

@Test
void activateAccess() {
}
Copy link
Contributor

Choose a reason for hiding this comment

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

PLease right a full test for these entity..

use you can use an h2 database which acts as an in memory DB for the test..

these is to ensure that the entire logic is working perfectly fine and everything is actually stored in a database.

Also please ensure to do a git pull so as to see recent changes, these will help you see the new recent project structure for our module.

@Koufan-De-King
Copy link
Contributor Author

Continued here

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.

Define Entity SeniormanagerAccess
2 participants