为什么说"The attribute name is undefined for the annotation type Parameterized.Parameters"



我写了如下代码:但是在编译时它会抛出编译错误说

"未为注释类型定义属性'name' 参数化.参数"

@RunWith(Parameterized.class)
public class TrustStandaloneTestSimple {
    @BeforeClass
    public static void setup() {
    }
    @Parameters(name = "propertyFileName")
    public static Collection<String[]> getParameters(){ 
        return Arrays.asList(new String [][]{{"trust.keystore.simple1.properties"},
                                            {"trust.keystore.simple2.properties"}});
    }

如果您有以下以外的其他导入可能会导致问题

import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

请检查您的进口

最新更新