-
Notifications
You must be signed in to change notification settings - Fork 0
Task/add location object #29
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
Conversation
ozgen
left a comment
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.
I added few comments @SelahattinSert
src/main/java/com/onboarding/camera/cameraonboarding/service/impl/CameraServiceImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/com/onboarding/camera/cameraonboarding/controller/CameraRestController.java
Outdated
Show resolved
Hide resolved
src/main/java/com/onboarding/camera/cameraonboarding/service/impl/CameraServiceImpl.java
Show resolved
Hide resolved
src/main/java/com/onboarding/camera/cameraonboarding/dto/LocationDto.java
Show resolved
Hide resolved
src/main/java/com/onboarding/camera/cameraonboarding/service/impl/CameraServiceImpl.java
Outdated
Show resolved
Hide resolved
|
Would it be better if i add new service for the location and handle the write operation to the database separately? @ozgen |
no could you read the documentations @SelahattinSert https://www.geeksforgeeks.org/spring-boot-transaction-management-using-transactional-annotation/ |
…ask/add-location-object
a8fbbdf to
57d8540
Compare
…ask/add-location-object
|
I am sorry about commit mess @ozgen |
ozgen
left a comment
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.
I didn't find any problem in your code @SelahattinSert,
you can start to write unit tests.
|
I added unit tests @ozgen |
ozgen
left a comment
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.
looks good to me @SelahattinSert
I am very busy in these days, I will create another issue when I am available,
thanks for your patience
| Location location = updatedCamera.getLocation(); | ||
|
|
||
| // assert | ||
| Assertions.assertThat(location).isNotNull(); |
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.
your assert usage is okay for me, however, you can also use it like this:
assertThat(location)
.isNotNull()
.satisfies(loc -> {
assertThat(loc.getLatitude())
.as("Check Latitude")
.isNotNull()
.isEqualTo(LATITUDE);
assertThat(loc.getLongitude())
.as("Check Longitude")
.isNotNull()
.isEqualTo(LONGITUDE);
assertThat(loc.getAddress())
.as("Check Address")
.isNotNull()
.isEqualTo(ADDRESS);
});
Because this approach allows chains multiple assertions directly related to the location. This reduces redundancy and improves readability.
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.
I was busy too, this week and the following week are my midterm weeks. Sorry if i took so long and thanks for your patience too @ozgen
Add location object without unit tests