Skip to content

Commit

Permalink
NOTIF-55 Migrate to resteasy-reactive and rest-client-reactive
Browse files Browse the repository at this point in the history
  • Loading branch information
gwenneg committed Apr 27, 2021
1 parent 792b19b commit 7f1ad39
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
16 changes: 4 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus.platform.version>1.13.2.Final</quarkus.platform.version>
<quarkus.platform.version>1.13.3.Final</quarkus.platform.version>
<quarkus-plugin.version>${quarkus.platform.version}</quarkus-plugin.version>
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
Expand Down Expand Up @@ -54,24 +54,20 @@
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy</artifactId>
<artifactId>quarkus-resteasy-reactive-jackson</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest-client</artifactId>
<artifactId>quarkus-resteasy-reactive-qute</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-jackson</artifactId>
<artifactId>quarkus-rest-client-reactive</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-mutiny</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-mutiny</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-context-propagation</artifactId>
Expand Down Expand Up @@ -112,10 +108,6 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-cache</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-qute</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-hibernate-reactive</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import io.smallrye.mutiny.Multi;
import io.smallrye.mutiny.Uni;
import org.hibernate.reactive.mutiny.Mutiny;
import org.reactivestreams.Publisher;

import javax.annotation.PostConstruct;
import javax.enterprise.context.ApplicationScoped;
Expand Down Expand Up @@ -108,7 +107,7 @@ public EndpointTypeProcessor endpointTypeToProcessor(EndpointType endpointType)
// TODO [BG Phase 2] Delete this method
public Multi<Endpoint> getEndpoints(String tenant, String bundleName, String applicationName, String eventTypeName) {
return resources.getTargetEndpoints(tenant, bundleName, applicationName, eventTypeName)
.onItem().transformToMultiAndConcatenate((Function<Endpoint, Publisher<Endpoint>>) endpoint -> {
.onItem().transformToMultiAndConcatenate((Function<Endpoint, Multi<Endpoint>>) endpoint -> {
// If the tenant has a default endpoint for the eventType, then add the target endpoints here
if (endpoint.getType() == EndpointType.DEFAULT) {
return defaultProcessor.getDefaultEndpoints(endpoint);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public class DbCleaner {
* is a temporary workaround to make our tests more reliable and easy to maintain.
*/
@DELETE
public void clean() {
session.withTransaction(transaction -> deleteAllFrom(EmailAggregation.class)
public Uni<Void> clean() {
return session.withTransaction(transaction -> deleteAllFrom(EmailAggregation.class)
.chain(() -> deleteAllFrom(EmailSubscription.class))
.chain(() -> deleteAllFrom(NotificationHistory.class))
.chain(() -> deleteAllFrom(EndpointDefault.class)) // TODO [BG Phase 2] Delete this line
Expand Down Expand Up @@ -82,7 +82,8 @@ public void clean() {
eventType.setDescription(DEFAULT_EVENT_TYPE_DESCRIPTION);
return appResources.addEventTypeToApplication(app.getId(), eventType);
})
).await().indefinitely();
.replaceWith(Uni.createFrom().voidItem())
);
}

private Uni<Integer> deleteAllFrom(Class<?> classname) {
Expand Down

0 comments on commit 7f1ad39

Please sign in to comment.