Search in sources :

Example 1 with TestAuthorizationServerInterceptor

use of io.camunda.zeebe.it.queryapi.util.TestAuthorizationServerInterceptor in project zeebe by camunda.

the class QueryApiIT method createInterceptorJar.

/**
 * Creates a JAR on the fly containing the {@link TestAuthorizationServerInterceptor}. For any
 * type which is not part of the distribution but is required by the server interceptor, you will
 * have to add it as a required type, including nested types.
 *
 * <p>NOTE: all types must be public, otherwise ByteBuddy will not be able to inject them!
 *
 * @return a JAR containing all types required by our test interceptor
 */
private static File createInterceptorJar() {
    final var byteBuddy = new ByteBuddy();
    final File jar;
    try {
        final var baseDir = Files.createTempDirectory("jarTemp").toFile();
        jar = byteBuddy.decorate(TestAuthorizationServerInterceptor.class).require(byteBuddy.decorate(TestAuthorizationServerInterceptor.NoopListener.class).make()).require(byteBuddy.decorate(TestAuthorizationListener.class).make()).require(byteBuddy.decorate(CloseAwareListener.class).make()).require(byteBuddy.decorate(TestAuthorizationListener.Authorization.class).make()).make().toJar(new File(baseDir, "interceptor.jar"));
    } catch (final IOException e) {
        throw new UncheckedIOException(e);
    }
    return jar;
}
Also used : ByteBuddy(net.bytebuddy.ByteBuddy) TestAuthorizationListener(io.camunda.zeebe.it.queryapi.util.TestAuthorizationListener) UncheckedIOException(java.io.UncheckedIOException) IOException(java.io.IOException) UncheckedIOException(java.io.UncheckedIOException) TestAuthorizationServerInterceptor(io.camunda.zeebe.it.queryapi.util.TestAuthorizationServerInterceptor) File(java.io.File) MountableFile(org.testcontainers.utility.MountableFile)

Example 2 with TestAuthorizationServerInterceptor

use of io.camunda.zeebe.it.queryapi.util.TestAuthorizationServerInterceptor in project zeebe by zeebe-io.

the class QueryApiIT method createInterceptorJar.

/**
 * Creates a JAR on the fly containing the {@link TestAuthorizationServerInterceptor}. For any
 * type which is not part of the distribution but is required by the server interceptor, you will
 * have to add it as a required type, including nested types.
 *
 * <p>NOTE: all types must be public, otherwise ByteBuddy will not be able to inject them!
 *
 * @return a JAR containing all types required by our test interceptor
 */
private static File createInterceptorJar() {
    final var byteBuddy = new ByteBuddy();
    final File jar;
    try {
        final var baseDir = Files.createTempDirectory("jarTemp").toFile();
        jar = byteBuddy.decorate(TestAuthorizationServerInterceptor.class).require(byteBuddy.decorate(TestAuthorizationServerInterceptor.NoopListener.class).make()).require(byteBuddy.decorate(TestAuthorizationListener.class).make()).require(byteBuddy.decorate(CloseAwareListener.class).make()).require(byteBuddy.decorate(TestAuthorizationListener.Authorization.class).make()).make().toJar(new File(baseDir, "interceptor.jar"));
    } catch (final IOException e) {
        throw new UncheckedIOException(e);
    }
    return jar;
}
Also used : ByteBuddy(net.bytebuddy.ByteBuddy) TestAuthorizationListener(io.camunda.zeebe.it.queryapi.util.TestAuthorizationListener) UncheckedIOException(java.io.UncheckedIOException) IOException(java.io.IOException) UncheckedIOException(java.io.UncheckedIOException) TestAuthorizationServerInterceptor(io.camunda.zeebe.it.queryapi.util.TestAuthorizationServerInterceptor) File(java.io.File) MountableFile(org.testcontainers.utility.MountableFile)

Example 3 with TestAuthorizationServerInterceptor

use of io.camunda.zeebe.it.queryapi.util.TestAuthorizationServerInterceptor in project zeebe by camunda-cloud.

the class QueryApiIT method createInterceptorJar.

/**
 * Creates a JAR on the fly containing the {@link TestAuthorizationServerInterceptor}. For any
 * type which is not part of the distribution but is required by the server interceptor, you will
 * have to add it as a required type, including nested types.
 *
 * <p>NOTE: all types must be public, otherwise ByteBuddy will not be able to inject them!
 *
 * @return a JAR containing all types required by our test interceptor
 */
private static File createInterceptorJar() {
    final var byteBuddy = new ByteBuddy();
    final File jar;
    try {
        final var baseDir = Files.createTempDirectory("jarTemp").toFile();
        jar = byteBuddy.decorate(TestAuthorizationServerInterceptor.class).require(byteBuddy.decorate(TestAuthorizationServerInterceptor.NoopListener.class).make()).require(byteBuddy.decorate(TestAuthorizationListener.class).make()).require(byteBuddy.decorate(CloseAwareListener.class).make()).require(byteBuddy.decorate(TestAuthorizationListener.Authorization.class).make()).make().toJar(new File(baseDir, "interceptor.jar"));
    } catch (final IOException e) {
        throw new UncheckedIOException(e);
    }
    return jar;
}
Also used : ByteBuddy(net.bytebuddy.ByteBuddy) TestAuthorizationListener(io.camunda.zeebe.it.queryapi.util.TestAuthorizationListener) UncheckedIOException(java.io.UncheckedIOException) IOException(java.io.IOException) UncheckedIOException(java.io.UncheckedIOException) TestAuthorizationServerInterceptor(io.camunda.zeebe.it.queryapi.util.TestAuthorizationServerInterceptor) File(java.io.File) MountableFile(org.testcontainers.utility.MountableFile)

Aggregations

TestAuthorizationListener (io.camunda.zeebe.it.queryapi.util.TestAuthorizationListener)3 TestAuthorizationServerInterceptor (io.camunda.zeebe.it.queryapi.util.TestAuthorizationServerInterceptor)3 File (java.io.File)3 IOException (java.io.IOException)3 UncheckedIOException (java.io.UncheckedIOException)3 ByteBuddy (net.bytebuddy.ByteBuddy)3 MountableFile (org.testcontainers.utility.MountableFile)3