From f993240cb979d3baab4a5ace3743489ecec22c49 Mon Sep 17 00:00:00 2001 From: aurea munoz Date: Thu, 16 Apr 2020 15:36:36 +0200 Subject: [PATCH] fix: add test to check the Unpaged class presence in the quarkus spring data api. fix #8571 chore: update spring-data-api version --- bom/runtime/pom.xml | 2 +- .../io/quarkus/it/spring/data/jpa/Song.java | 41 +++++++++++++++++++ .../it/spring/data/jpa/SongRepository.java | 7 ++++ .../it/spring/data/jpa/SongResource.java | 27 ++++++++++++ .../src/main/resources/import.sql | 7 ++++ 5 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 integration-tests/spring-data-jpa/src/main/java/io/quarkus/it/spring/data/jpa/Song.java create mode 100644 integration-tests/spring-data-jpa/src/main/java/io/quarkus/it/spring/data/jpa/SongRepository.java create mode 100644 integration-tests/spring-data-jpa/src/main/java/io/quarkus/it/spring/data/jpa/SongResource.java diff --git a/bom/runtime/pom.xml b/bom/runtime/pom.xml index ae885f504350e..9604a0e902b84 100644 --- a/bom/runtime/pom.xml +++ b/bom/runtime/pom.xml @@ -175,7 +175,7 @@ 0.19.1 2.2.0 5.2.SP1 - 2.1.Final + 2.1.SP1 5.2.Final 2.1.SP1 2.4.4.Final diff --git a/integration-tests/spring-data-jpa/src/main/java/io/quarkus/it/spring/data/jpa/Song.java b/integration-tests/spring-data-jpa/src/main/java/io/quarkus/it/spring/data/jpa/Song.java new file mode 100644 index 0000000000000..f7a057ea0bc3a --- /dev/null +++ b/integration-tests/spring-data-jpa/src/main/java/io/quarkus/it/spring/data/jpa/Song.java @@ -0,0 +1,41 @@ +package io.quarkus.it.spring.data.jpa; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; + +@Entity +public class Song { + + @Id + @GeneratedValue + public Long id; + + private String title; + + private String author; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getAuthor() { + return author; + } + + public void setAuthor(String author) { + this.author = author; + } +} diff --git a/integration-tests/spring-data-jpa/src/main/java/io/quarkus/it/spring/data/jpa/SongRepository.java b/integration-tests/spring-data-jpa/src/main/java/io/quarkus/it/spring/data/jpa/SongRepository.java new file mode 100644 index 0000000000000..c18a9acf7ae8f --- /dev/null +++ b/integration-tests/spring-data-jpa/src/main/java/io/quarkus/it/spring/data/jpa/SongRepository.java @@ -0,0 +1,7 @@ +package io.quarkus.it.spring.data.jpa; + +import org.springframework.data.jpa.repository.JpaRepository; + +public interface SongRepository extends JpaRepository { + +} diff --git a/integration-tests/spring-data-jpa/src/main/java/io/quarkus/it/spring/data/jpa/SongResource.java b/integration-tests/spring-data-jpa/src/main/java/io/quarkus/it/spring/data/jpa/SongResource.java new file mode 100644 index 0000000000000..fe9a87ddedc7e --- /dev/null +++ b/integration-tests/spring-data-jpa/src/main/java/io/quarkus/it/spring/data/jpa/SongResource.java @@ -0,0 +1,27 @@ +package io.quarkus.it.spring.data.jpa; + +import java.util.List; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; + +import org.springframework.data.domain.Pageable; + +@Path("/song") +public class SongResource { + + private final SongRepository songRepository; + + public SongResource(SongRepository songRepository) { + this.songRepository = songRepository; + } + + @GET + @Produces("application/json") + @Path("/all") + public List all() { + Pageable wholePage = Pageable.unpaged(); + return songRepository.findAll(); + } +} diff --git a/integration-tests/spring-data-jpa/src/main/resources/import.sql b/integration-tests/spring-data-jpa/src/main/resources/import.sql index 5701057c5aee9..b994b281a35c2 100644 --- a/integration-tests/spring-data-jpa/src/main/resources/import.sql +++ b/integration-tests/spring-data-jpa/src/main/resources/import.sql @@ -41,3 +41,10 @@ INSERT INTO post(id, title, bypass, posted) VALUES (3, 'Quarkus 0.20 released', INSERT INTO post_comment(id, post_id, review) VALUES (1, 1, 'Excellent!'); INSERT INTO post_comment(id, post_id, review) VALUES (2, 1, 'Wonderful!'); +INSERT INTO song(id, title, author) VALUES (1, 'Consejo de sabios' , 'Vetusta Morla'); +INSERT INTO song(id, title, author) VALUES (2, 'Nothing else mothers' , 'Metallica'); +INSERT INTO song(id, title, author) VALUES (3, 'Ephedra' , 'My Sleeping Karma'); +INSERT INTO song(id, title, author) VALUES (4, 'Whatever it takes' , 'Imagine Dragons'); +INSERT INTO song(id, title, author) VALUES (5, 'Santos que yo te pinte' , 'Los planetas'); +INSERT INTO song(id, title, author) VALUES (6, 'Drinkee' , 'Sofi Tukker'); +