简体   繁体   English

你如何为空的 function 切入点编写 JUnit 测试

[英]How do you write a JUnit test for an empty function Pointcut

I am trying to write a JUnit test for this method.我正在尝试为此方法编写一个 JUnit 测试。 I am not familiar with Pointcut.我不熟悉切入点。 Any advice?有什么建议吗?

 /**
     * Pointcut that matches all repositories, services and Web REST endpoints.
     */
    @Pointcut("within(@org.springframework.stereotype.Repository *)" +
        " || within(@org.springframework.stereotype.Service *)" +
        " || within(@org.springframework.web.bind.annotation.RestController *)")
    public void springBeanPointcut() {
        // Method is empty as this is just a Pointcut, the implementations are in the advices.
    }

Just make a new test and have it call springBeanPointcut()只需进行一个新测试并让它调用 springBeanPointcut()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM