首页 > TAG信息列表 > tourId
[Unit Testing Java] Unit testing with Mockito vs. integration testing
Service: package com.example.ec.service; import com.example.ec.domain.Tour; import com.example.ec.domain.TourRating; import com.example.ec.repo.TourRatingRepository; import com.example.ec.repo.TourRepository; import org.slf4j.Logger; import org.slf4j.Lo[Spring Java] identify transactional business services boundaries
If one request failed, we want to keep database untouched as if the request never happen. Spring makes it easy to add: @Transactional To the method or Class: For example: @Service @Transactional public class TourRatingService { private TourRati[Java Spring MVC] @GetMapping, @PostMapping, @PutMapping, @PatchMapping & @DeleteMapping
package com.example.ec.web; import com.example.ec.domain.Tour; import com.example.ec.domain.TourRating; import com.example.ec.domain.TourRatingPk; import com.example.ec.repo.TourRatingRepository; import com.example.ec.repo.TourRepository; import org.spri[Java Spring MVC] Paging and sorting DTOs
Repo: package com.example.ec.repo; import com.example.ec.domain.TourRating; import com.example.ec.domain.TourRatingPk; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.reposito[Java Spring] @PathVariable, @Vallidated, @PostMapping & @ResponseStatus
Controller: package com.example.ec.web; import com.example.ec.domain.Tour; import com.example.ec.domain.TourRating; import com.example.ec.domain.TourRatingPk; import com.example.ec.repo.TourRatingRepository; import com.example.ec.repo.TourRepository; im