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;
}
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;
}
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;
}
Aggregations