-
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.
Merge pull request #16313 from FroMage/16182
Support mocking PanacheEntityBase.persist static methods
- Loading branch information
Showing
12 changed files
with
224 additions
and
10 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
16 changes: 16 additions & 0 deletions
16
.../java/io/quarkus/it/mongodb/panache/reactive/person/MockableReactivePersonRepository.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,16 @@ | ||
package io.quarkus.it.mongodb.panache.reactive.person; | ||
|
||
import java.util.List; | ||
|
||
import javax.enterprise.context.ApplicationScoped; | ||
|
||
import io.quarkus.mongodb.panache.reactive.ReactivePanacheMongoRepositoryBase; | ||
import io.quarkus.panache.common.Sort; | ||
import io.smallrye.mutiny.Uni; | ||
|
||
@ApplicationScoped | ||
public class MockableReactivePersonRepository implements ReactivePanacheMongoRepositoryBase<ReactivePersonEntity, Long> { | ||
public Uni<List<ReactivePersonEntity>> findOrdered() { | ||
return findAll(Sort.by("lastname", "firstname")).list(); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...che/src/main/java/io/quarkus/it/mongodb/panache/reactive/person/ReactivePersonEntity.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 |
---|---|---|
@@ -1,12 +1,20 @@ | ||
package io.quarkus.it.mongodb.panache.reactive.person; | ||
|
||
import java.util.List; | ||
|
||
import org.bson.codecs.pojo.annotations.BsonId; | ||
|
||
import io.quarkus.mongodb.panache.reactive.ReactivePanacheMongoEntityBase; | ||
import io.quarkus.panache.common.Sort; | ||
import io.smallrye.mutiny.Uni; | ||
|
||
public class ReactivePersonEntity extends ReactivePanacheMongoEntityBase { | ||
@BsonId | ||
public Long id; | ||
public String firstname; | ||
public String lastname; | ||
|
||
public static Uni<List<ReactivePersonEntity>> findOrdered() { | ||
return findAll(Sort.by("lastname", "firstname")).list(); | ||
} | ||
} |
Oops, something went wrong.