Skip to content

Commit

Permalink
Merge pull request #47 from Central-MakeUs/test/repository
Browse files Browse the repository at this point in the history
test: repository 및 통합 테스트 구성 수정 및 동시성 테스트 작성
  • Loading branch information
AlmondBreez3 authored Apr 30, 2024
2 parents 6081dda + 120f0a1 commit d07a283
Show file tree
Hide file tree
Showing 27 changed files with 57 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.api.recommendedPopcorn.service;
package com.example.api.recommendedPopcorn.application;


import com.example.adaptor.UseCase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.api.recommendedPopcorn.service;
package com.example.api.recommendedPopcorn.application;


import com.example.adaptor.UseCase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.api.recommendedPopcorn.service;
package com.example.api.recommendedPopcorn.application;


import com.example.adaptor.UseCase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.api.recommendedPopcorn.service;
package com.example.api.recommendedPopcorn.application;


import com.example.adaptor.UseCase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.example.api.recommendedPopcorn.controller;


import com.example.api.recommendedPopcorn.application.GetRecommendedPopocornUseCase;
import com.example.api.recommendedPopcorn.application.GetRecommendedRandomPopcornUseCase;
import com.example.api.recommendedPopcorn.application.PostRecommendPopcornUseCase;
import com.example.api.recommendedPopcorn.application.PostVoteRecommendedPopcorn;
import com.example.api.recommendedPopcorn.dto.request.RecommendedPopcornRequest;
import com.example.api.recommendedPopcorn.service.GetRecommendedPopocornUseCase;
import com.example.api.recommendedPopcorn.service.GetRecommendedRandomPopcornUseCase;
import com.example.api.recommendedPopcorn.service.PostRecommendPopcornUseCase;
import com.example.api.recommendedPopcorn.service.PostVoteRecommendedPopcorn;
import com.example.domains.recommendedPopcorn.entity.RecommendedPopcorn;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.api.screening.service;
package com.example.api.screening.api;


import com.example.adaptor.UseCase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.api.screening.service;
package com.example.api.screening.api;


import com.example.adaptor.UseCase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.api.screening.service;
package com.example.api.screening.api;


import com.example.adaptor.UseCase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.api.screening.service;
package com.example.api.screening.api;


import com.example.adaptor.UseCase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.api.screening.service;
package com.example.api.screening.api;


import com.example.adaptor.UseCase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.api.screening.service;
package com.example.api.screening.api;


import com.example.adaptor.UseCase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.api.screening.service;
package com.example.api.screening.api;


import com.example.adaptor.UseCase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.api.screening.service;
package com.example.api.screening.api;


import com.example.adaptor.UseCase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.api.screening.service;
package com.example.api.screening.api;


import com.example.adaptor.UseCase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.api.screening.service;
package com.example.api.screening.api;


import com.example.adaptor.UseCase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.api.screening.service;
package com.example.api.screening.api;


import com.example.adaptor.UseCase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.api.screening.service;
package com.example.api.screening.api;


import com.example.adaptor.UseCase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.api.screening.service;
package com.example.api.screening.api;


import com.example.adaptor.UseCase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.api.screening.service;
package com.example.api.screening.api;


import com.example.adaptor.UseCase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.api.screening.service;
package com.example.api.screening.api;


import com.example.adaptor.UseCase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.api.screening.service;
package com.example.api.screening.api;


import com.example.adaptor.UseCase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.api.screening.service;
package com.example.api.screening.api;


import com.example.adaptor.UseCase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.api.screening.service;
package com.example.api.screening.api;


import com.example.adaptor.UseCase;
Expand Down Expand Up @@ -56,6 +56,15 @@ private PostReviewResponse reviewUpload(
request.getNegative());
Screening screening = screeningAdaptor.findById(userScreening.getScreening().getId());

updateScreeningRate(request, screening);

// save
reviewAdaptor.save(newSreeningReview);
// screeningAdaptor.save(screening);
return PostReviewResponse.from(newSreeningReview);
}

public synchronized void updateScreeningRate(PostReviewRequest request, Screening screening) {
calculateCount(
request.isScreeningReview(),
request.isLocationReview(),
Expand All @@ -64,11 +73,6 @@ private PostReviewResponse reviewUpload(
calculateRate(request.isAfterScreening(), screening);
incrementNegative(request.getNegative(), screening);
incrementPositive(request.getPositive(), screening);

// save
reviewAdaptor.save(newSreeningReview);
// screeningAdaptor.save(screening);
return PostReviewResponse.from(newSreeningReview);
}

@Transactional
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.api.screening.service;
package com.example.api.screening.api;


import com.example.adaptor.UseCase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.api.screening.service;
package com.example.api.screening.api;


import com.example.adaptor.UseCase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@


import com.example.api.config.response.SuccessResponse;
import com.example.api.screening.api.*;
import com.example.api.screening.dto.request.PostReviewRequest;
import com.example.api.screening.dto.request.PostScreeningRequest;
import com.example.api.screening.dto.response.*;
import com.example.api.screening.service.*;
import com.example.domains.common.util.SliceResponse;
import com.example.domains.common.util.SliceUtil;
import com.example.domains.screening.adaptor.ScreeningAdaptor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,23 @@ public class Positive {
private boolean actingIsGood = false;

private boolean chemistryIsGood = false;
// @Builder
// private Positive() {
// this.cineMaster = false;
// this.greatFilming = false;
// this.pom = false;
// this.animationIsGood = false;
// this.artIsGood = false;
// this.setIsArt = false;
// this.custom = false;
// this.music = false;
// this.ost = false;
// this.writtenByGod = false;
// this.topicIsGood = false;
// this.linesAreGood = false;
// this.endingIsGood = false;
// this.castingIsGood = false;
// this.actingIsGood = false;
// this.chemistryIsGood = false;
// }
}

0 comments on commit d07a283

Please sign in to comment.