Skip to content

Commit

Permalink
Merge pull request #237 from kakao-tech-campus-2nd-step3/docs/#185-re…
Browse files Browse the repository at this point in the history
…adme

[test] videorepositorytest 깨지는 거 해결
  • Loading branch information
suhyeon7497 authored Nov 15, 2024
2 parents 475c87e + 35a1e0e commit f69c8c2
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 14 deletions.
47 changes: 47 additions & 0 deletions src/main/generated/team7/inplace/admin/banner/domain/QBanner.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package team7.inplace.admin.banner.domain;

import static com.querydsl.core.types.PathMetadataFactory.*;

import com.querydsl.core.types.dsl.*;

import com.querydsl.core.types.PathMetadata;
import javax.annotation.processing.Generated;
import com.querydsl.core.types.Path;


/**
* QBanner is a Querydsl query type for Banner
*/
@Generated("com.querydsl.codegen.DefaultEntitySerializer")
public class QBanner extends EntityPathBase<Banner> {

private static final long serialVersionUID = -455211757L;

public static final QBanner banner = new QBanner("banner");

public final DateTimePath<java.time.LocalDateTime> endDate = createDateTime("endDate", java.time.LocalDateTime.class);

public final NumberPath<Long> id = createNumber("id", Long.class);

public final StringPath imgName = createString("imgName");

public final StringPath imgPath = createString("imgPath");

public final BooleanPath isFixed = createBoolean("isFixed");

public final DateTimePath<java.time.LocalDateTime> startDate = createDateTime("startDate", java.time.LocalDateTime.class);

public QBanner(String variable) {
super(Banner.class, forVariable(variable));
}

public QBanner(Path<? extends Banner> path) {
super(path.getType(), path.getMetadata());
}

public QBanner(PathMetadata metadata) {
super(Banner.class, metadata);
}

}

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package team7.inplace.crawling.domain;
package team7.inplace.admin.crawling.domain;

import static com.querydsl.core.types.PathMetadataFactory.*;

Expand All @@ -15,7 +15,7 @@
@Generated("com.querydsl.codegen.DefaultEntitySerializer")
public class QYoutubeChannel extends EntityPathBase<YoutubeChannel> {

private static final long serialVersionUID = 2131098359L;
private static final long serialVersionUID = -73514634L;

public static final QYoutubeChannel youtubeChannel = new QYoutubeChannel("youtubeChannel");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package team7.inplace.global.exception;
package team7.inplace.admin.error;

import static com.querydsl.core.types.PathMetadataFactory.*;

Expand All @@ -15,7 +15,7 @@
@Generated("com.querydsl.codegen.DefaultEntitySerializer")
public class QErrorLog extends EntityPathBase<ErrorLog> {

private static final long serialVersionUID = 50351046L;
private static final long serialVersionUID = -245768895L;

public static final QErrorLog errorLog = new QErrorLog("errorLog");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import team7.inplace.place.domain.Place;
import team7.inplace.video.domain.Video;

Expand All @@ -15,7 +16,7 @@ public interface VideoRepository extends JpaRepository<Video, Long> {
List<Video> findTop10ByOrderByViewCountIncreaseDesc(Pageable pageable);

@Query("SELECT v FROM Video v JOIN FETCH v.place JOIN FETCH v.influencer WHERE v.influencer.id IN :influencerIds ORDER BY v.id DESC")
List<Video> findTop10ByInfluencerIdIn(List<Long> influencerIds, Pageable pageable);
List<Video> findTop10ByInfluencerIdIn(@Param("influencerIds") List<Long> influencerIds, Pageable pageable);

@Query("SELECT v FROM Video v JOIN FETCH v.place JOIN FETCH v.influencer ORDER BY v.id DESC")
List<Video> findTop10ByOrderByIdDesc(Pageable pageable);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
package team7.inplace.config.annotation;

import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.TestPropertySource;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.TestPropertySource;

@Target(ElementType.TYPE) // 클래스에 붙일 수 있도록 설정
@Retention(RetentionPolicy.RUNTIME) // 런타임에 유지
@SpringBootTest // SpringBootTest를 포함
@TestPropertySource(properties = {
"spring.datasource.url=jdbc:h2:mem:testdb",
"spring.datasource.driver-class-name=org.h2.Driver",
"spring.datasource.username=sa",
"spring.datasource.password=",
"spring.jpa.hibernate.ddl-auto=create-drop",
"spring.sql.init.mode=never"
"spring.datasource.url=jdbc:h2:mem:testdb",
"spring.datasource.driver-class-name=org.h2.Driver",
"spring.datasource.username=sa",
"spring.datasource.password=",
"spring.jpa.hibernate.ddl-auto=create-drop",
"spring.sql.init.mode=never"
})
public @interface CustomRepositoryTest {

Expand Down

0 comments on commit f69c8c2

Please sign in to comment.