All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.diagrid.dapr.DaprLocal Maven / Gradle / Ivy

There is a newer version: 0.10.7
Show newest version
package io.diagrid.dapr;

import org.springframework.test.context.DynamicPropertyRegistry;
import org.springframework.test.context.DynamicPropertySource;
import org.testcontainers.Testcontainers;
import org.testcontainers.junit.jupiter.Container;

public interface DaprLocal {
    
    @Container
    DaprContainer dapr = new DaprContainer("daprio/daprd")
            .withAppName("local-dapr-app")
            .withAppPort(8080)
            .withAppChannelAddress("host.testcontainers.internal");

    @DynamicPropertySource
    static void daprProperties(DynamicPropertyRegistry registry) {
        Testcontainers.exposeHostPorts(8080);
        System.setProperty("dapr.grpc.port", Integer.toString(dapr.getGRPCPort()));
        System.setProperty("dapr.http.port", Integer.toString(dapr.getHTTPPort()));
    }
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy