-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
REST Data Panache dev mode fix #9510
- Loading branch information
Gytis Trikleris
committed
Sep 29, 2020
1 parent
c9ab9fe
commit 3e1af27
Showing
4 changed files
with
77 additions
and
23 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
.../test/java/io/quarkus/hibernate/orm/rest/data/panache/deployment/AbstractDevModeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package io.quarkus.hibernate.orm.rest.data.panache.deployment; | ||
|
||
import static io.restassured.RestAssured.given; | ||
import static io.restassured.RestAssured.when; | ||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import io.restassured.response.Response; | ||
|
||
public abstract class AbstractDevModeTest { | ||
|
||
@Test | ||
void testGet() { | ||
when().get("/items/1") | ||
.then().statusCode(200); | ||
} | ||
|
||
@Test | ||
void testCreate() { | ||
Response response = given().accept("application/json") | ||
.and().contentType("application/json") | ||
.and().body("{\"name\": \"test-simple\", \"collection\": {\"id\": \"full\"}}") | ||
.when().post("/items") | ||
.thenReturn(); | ||
assertThat(response.getStatusCode()).isEqualTo(201); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...s/hibernate/orm/rest/data/panache/deployment/entity/PanacheEntityResourceDevModeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package io.quarkus.hibernate.orm.rest.data.panache.deployment.entity; | ||
|
||
import org.jboss.shrinkwrap.api.ShrinkWrap; | ||
import org.jboss.shrinkwrap.api.spec.JavaArchive; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.hibernate.orm.rest.data.panache.deployment.AbstractDevModeTest; | ||
import io.quarkus.test.QuarkusDevModeTest; | ||
|
||
public class PanacheEntityResourceDevModeTest extends AbstractDevModeTest { | ||
|
||
@RegisterExtension | ||
static final QuarkusDevModeTest TEST = new QuarkusDevModeTest() | ||
.setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class) | ||
.addClasses(Collection.class, AbstractItem.class, Item.class, ItemsController.class) | ||
.addAsResource("application.properties") | ||
.addAsResource("import.sql")); | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
...ate/orm/rest/data/panache/deployment/repository/PanacheRepositoryResourceDevModeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package io.quarkus.hibernate.orm.rest.data.panache.deployment.repository; | ||
|
||
import org.jboss.shrinkwrap.api.ShrinkWrap; | ||
import org.jboss.shrinkwrap.api.spec.JavaArchive; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.hibernate.orm.rest.data.panache.deployment.AbstractDevModeTest; | ||
import io.quarkus.test.QuarkusDevModeTest; | ||
|
||
public class PanacheRepositoryResourceDevModeTest extends AbstractDevModeTest { | ||
|
||
@RegisterExtension | ||
static final QuarkusDevModeTest TEST = new QuarkusDevModeTest() | ||
.setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class) | ||
.addClasses(Collection.class, AbstractItem.class, Item.class, ItemsController.class, ItemsRepository.class) | ||
.addAsResource("application.properties") | ||
.addAsResource("import.sql")); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters