Commit 2399bfb7 authored by Ahmed Ashour's avatar Ahmed Ashour Committed by skylot

test: add case for #504

parent 11cee083
package jadx.tests.integration.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.junit.jupiter.api.Test;
import jadx.NotYetImplemented;
import jadx.core.dex.nodes.ClassNode;
import jadx.tests.api.IntegrationTest;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.MatcherAssert.assertThat;
public class AnnotationsRenaming extends IntegrationTest {
public static class TestCls {
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public static @interface A {
int x();
}
@A(x = 5)
void test() {
}
}
@Test
@NotYetImplemented
public void test504() {
enableDeobfuscation();
ClassNode cls = getClassNode(TestCls.class);
String code = cls.getCode().toString();
assertThat(code, containsString("public static @interface "));
assertThat(code, not(containsString("(x = 5)")));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment