I have really weird issue. Heres my method
@SomeAnnotation(value = "test")
public void doSomethink() {
..
}
When I'm using my application everythink works fine (when calling method doSomethink()
in debug it also goes inside annotation), but when I run test like below
@Test
public void testDoSomethink() {
service.doSomethink();
}
My test completly ignores annotation and goes straight into doSomethink
method. Am i missing somethink? I think that piece of code is enough but let me know if you need some more.
SomeAnnotation
package org.springframework.security.access.prepost;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
public @interface SomeAnnotation{
String value();
}
By ignore i mean that when running through test it simply bypass annotation like its not even there