Skip to content

Commit

Permalink
Merge pull request #189 from kakao-tech-campus-2nd-step3/fix/#188-tes…
Browse files Browse the repository at this point in the history
…t-fix

[Fix] 에러나는 테스트코드를 수정했어요
  • Loading branch information
sanghee0820 authored Nov 14, 2024
2 parents c025172 + 9c7839f commit c78a070
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
15 changes: 10 additions & 5 deletions src/main/java/team7/inplace/video/domain/Video.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
package team7.inplace.video.domain;

import jakarta.persistence.*;
import static jakarta.persistence.GenerationType.IDENTITY;
import static lombok.AccessLevel.PROTECTED;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import lombok.Getter;
import lombok.NoArgsConstructor;
import team7.inplace.influencer.domain.Influencer;
import team7.inplace.place.domain.Place;

import static jakarta.persistence.GenerationType.IDENTITY;
import static lombok.AccessLevel.PROTECTED;

@Entity
@Getter
@NoArgsConstructor(access = PROTECTED)
Expand Down Expand Up @@ -54,7 +59,7 @@ public String getVideoUUID() {
public void updateViewCount(Long viewCount) {
if (this.viewCount == -1L) {
this.viewCount = viewCount;
this.viewCountIncrease = viewCount;
this.viewCountIncrease = 0L;
return;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package team7.inplace.crawling.application;

import static org.junit.jupiter.api.Assertions.assertEquals;

import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import team7.inplace.admin.crawling.application.AddressUtil;

import static org.junit.jupiter.api.Assertions.assertEquals;

class AddressUtilTest {

@DisplayName("주소 추출 테스트 1")
Expand All @@ -16,7 +16,7 @@ void extractAddressFromJsonNodeTest1() {
[참조은 생고기]
대구 북구 복현로 78 (복현2동 266-9)
""";
final String address = "대구 북구 복현로 78";
final String address = "복현로 78";

// when
String result = AddressUtil.extractAddressFromString(description);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package team7.inplace.crawling.client;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import team7.inplace.admin.crawling.client.YoutubeClient;

import static org.assertj.core.api.Assertions.assertThat;

@SpringBootTest
@ActiveProfiles("test")
class YoutubeClientTest {
Expand All @@ -22,9 +22,9 @@ void crawlingTest() {
final String videoId = null;
var response = youtubeClient.getVideos(playlistId, videoId);

// 2024. 10. 2기준 154개
// 2024. 11. 15일기준 157개
// regex로 판별되는 기준 138개
final int expectedSize = 154;
final int expectedSize = 157;
assertThat(response.size())
.isEqualTo(expectedSize);
}
Expand Down

0 comments on commit c78a070

Please sign in to comment.