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

Feature 456 user list assigned projects #3586

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

lorriborri
Copy link
Member

- tests need to be adjusted
- not working rn
- added unit tests for service
- renamed classes
- use Boolean instead of Primitive
- renamed classes
- use Boolean instead of Primitive
@lorriborri lorriborri marked this pull request as ready for review November 6, 2024 14:20
Copy link
Collaborator

@hamidonos hamidonos left a comment

Choose a reason for hiding this comment

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

Good work but there are some findings that need to be looked at

  1. You are missing the license header in many classes
  2. Think about using AssertJ "assertThat(...).is(...)" for testing. It has a fluent API and is generally better for testing in my opinion
  3. Simple POJO constructs like entities don't require mocking in my opinion. This will make the test setup much more complex with no real benefit. Just initialize the object right away with some default values.
  4. Your test cases could be more readable. I'd suggest to take a look at the interface ArgumentsProvider where you initialize the desired user objects and projects directly with the right values. The method setUpTestCase does to much in my opinion.

@lorriborri lorriborri force-pushed the feature-456-user-list-projects branch from 73c7adb to f5b5e33 Compare November 8, 2024 15:05
@lorriborri lorriborri changed the title Feature 456 user list projects Feature 456 list assigned projects Nov 8, 2024
@lorriborri lorriborri changed the title Feature 456 list assigned projects Feature 456 user list assigned projects Nov 8, 2024
private String projectId;
private String owner;
private Boolean isOwned;
@JsonInclude(JsonInclude.Include.NON_NULL)
Copy link
Collaborator

@hamidonos hamidonos Nov 12, 2024

Choose a reason for hiding this comment

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

here you put the annotation on the field while you put the other annotations on the getters
while both approaches work I would not mix them unless there is a reason to

consider putting all annotations on one level (either field or getter)

@@ -23,6 +23,7 @@ public class SecHubTestURLBuilder extends AbstractTestURLBuilder {
private static final String API_ADMIN_CONFIG = API_ADMIN + "/config";
private static final String API_ADMIN_CONFIG_MAPPING = API_ADMIN_CONFIG + "/mapping";
private static final String API_PROJECT = "/api/project";
public static final String API_PROJECTS = "/api/projects";
Copy link
Collaborator

Choose a reason for hiding this comment

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

did you mean to make this public?

all other constants are private

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.

Usecase: lists projects with data
2 participants