15 changed files with 213 additions and 58 deletions
@ -0,0 +1,20 @@
|
||||
package com.redhat.pctsec.model.jpa; |
||||
|
||||
import com.redhat.pctsec.model.Scan; |
||||
import io.quarkus.hibernate.orm.panache.PanacheRepositoryBase; |
||||
import io.smallrye.mutiny.Uni; |
||||
import jakarta.enterprise.context.ApplicationScoped; |
||||
|
||||
import java.util.UUID; |
||||
|
||||
@ApplicationScoped |
||||
public class ScanRepository implements PanacheRepositoryBase<Scan, UUID> { |
||||
|
||||
|
||||
|
||||
public Uni<Scan> findByProduct(String product) |
||||
{ |
||||
return find("product", product).firstResult(); |
||||
} |
||||
|
||||
} |
||||
@ -1,8 +0,0 @@
|
||||
package com.redhat.pctsec; |
||||
|
||||
import io.quarkus.test.junit.QuarkusIntegrationTest; |
||||
|
||||
@QuarkusIntegrationTest |
||||
public class GreetingResourceIT extends GreetingResourceTest { |
||||
// Execute the same tests but in packaged mode.
|
||||
} |
||||
@ -1,21 +0,0 @@
|
||||
package com.redhat.pctsec; |
||||
|
||||
import io.quarkus.test.junit.QuarkusTest; |
||||
import org.junit.jupiter.api.Test; |
||||
|
||||
import static io.restassured.RestAssured.given; |
||||
import static org.hamcrest.CoreMatchers.is; |
||||
|
||||
@QuarkusTest |
||||
public class GreetingResourceTest { |
||||
|
||||
@Test |
||||
public void testHelloEndpoint() { |
||||
given() |
||||
.when().get("/hello") |
||||
.then() |
||||
.statusCode(200) |
||||
.body(is("Hello from RESTEasy Reactive")); |
||||
} |
||||
|
||||
} |
||||
Loading…
Reference in new issue