-
Notifications
You must be signed in to change notification settings - Fork 65
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
base: develop
Are you sure you want to change the base?
Conversation
lorriborri
commented
Nov 5, 2024
- closes Usecase: lists projects with data #456
- 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
There was a problem hiding this 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
- You are missing the license header in many classes
- Think about using AssertJ "assertThat(...).is(...)" for testing. It has a fluent API and is generally better for testing in my opinion
- 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.
- 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 methodsetUpTestCase
does to much in my opinion.
.../src/main/java/com/mercedesbenz/sechub/domain/administration/AdministrationAPIConstants.java
Outdated
Show resolved
Hide resolved
...tration/src/main/java/com/mercedesbenz/sechub/domain/administration/project/ProjectData.java
Show resolved
Hide resolved
...tration/src/main/java/com/mercedesbenz/sechub/domain/administration/project/ProjectData.java
Show resolved
Hide resolved
...tration/src/main/java/com/mercedesbenz/sechub/domain/administration/project/ProjectData.java
Outdated
Show resolved
Hide resolved
...c/main/java/com/mercedesbenz/sechub/domain/administration/project/ProjectRestController.java
Outdated
Show resolved
Hide resolved
...tion/src/main/java/com/mercedesbenz/sechub/domain/administration/project/ProjectService.java
Outdated
Show resolved
Hide resolved
.../src/test/java/com/mercedesbenz/sechub/domain/administration/project/ProjectServiceTest.java
Outdated
Show resolved
Hide resolved
.../src/test/java/com/mercedesbenz/sechub/domain/administration/project/ProjectServiceTest.java
Outdated
Show resolved
Hide resolved
...tration/src/main/java/com/mercedesbenz/sechub/domain/administration/project/ProjectData.java
Show resolved
Hide resolved
...tion/src/main/java/com/mercedesbenz/sechub/domain/administration/project/ProjectService.java
Outdated
Show resolved
Hide resolved
73c7adb
to
f5b5e33
Compare
private String projectId; | ||
private String owner; | ||
private Boolean isOwned; | ||
@JsonInclude(JsonInclude.Include.NON_NULL) |
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
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