Skip to content
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

[Fix] 에러나는 테스트코드를 수정했어요 #189

Merged
merged 3 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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