use of co.cask.cdap.common.security.AuthEnforceRewriter in project cdap by caskdata.
the class AuthEnforceRewriterTest method rewrite.
private ClassDefinition rewrite(Class cls) throws Exception {
AuthEnforceRewriter rewriter = new AuthEnforceRewriter();
URL url = cls.getClassLoader().getResource(cls.getName().replace('.', '/') + ".class");
Assert.assertNotNull(url);
try (InputStream is = url.openStream()) {
return new ClassDefinition(rewriter.rewriteClass(cls.getName(), is), Type.getInternalName(cls));
}
}
Aggregations