NutzCN Logo
问答 你好,请教个问题,为什么我的@Inject注入不进值??
发布于 1826天前 作者 qq_6dd44082 1677 次浏览 复制 上一个帖子 下一个帖子
标签:

我的应用类

/**
 * @author wangShaoBin
 * @date 2019/11/15
 */
@IocBean
public class PayTest {
    @Inject
    protected AliConfig aliConfig;
    @Test
    public void testScan() throws AlipayApiException, InstantiationException, IllegalAccessException, IOException {

mainmodule类

import org.nutz.mvc.annotation.*;
import org.nutz.mvc.ioc.provider.ComboIocProvider;

@SetupBy(value = MainSetup.class)
@IocBy(type = ComboIocProvider.class, args = {"*js", "ioc/",
		"*anno", MainModule.PACKAGE_NAME,
		"*tx"})
@Modules(scanPackage = true, packages = { MainModule.PACKAGE_NAME})
@Encoding(input = org.nutz.lang.Encoding.UTF8, output = org.nutz.lang.Encoding.UTF8)
public class MainModule {
	public static final String PACKAGE_NAME = "com.hanhuang.alipaydemo";
}

js配置文件

var ioc = {
    aliConfig: {
        type: "com.hanhuang.alipaydemo.config.AliConfig",
        args:[
            "https://openapi.alipaydev.com/gateway.do",
            "2016101700708551",
            "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCaQuEjg1bms/7WRuie/0KqIwd61YRMY6e0Snky84w/fkDk5MdFo9tt6LKzCNugBNuOZq1daLc1aTDsAyO/+YrsWUEFa5+BCpaK/lazly2zLX2g9pdoqmH16PM1bDhZMB5VGBiuRPb831ZnVtDiTit/wVxtNCb1M4en7p+KXg2wqhm/b95ElOlY+N7JsxqOdKa3hbVQN5sRIqcw5LvUM1jNo5PoaeWgwYwtYAjbUnI61B3dzXjzFbDdVp2lLULLZ5ZuRzGfSoOZNzAWJiVKscKyO2MvqJrWLYK2y/4mx8gHoleH/lAGnZ87M5tscSrm1hVdaRkjYblTBXFyaomhuadjAgMBAAECggEAMLd4VHfRBPDJRTCFnFju275OSWuO6XT7bIOsfPvPSen8Yo0hpYuW68H2VXYxrfp6wCELFRnR6is7SP3A14reZb/WOfkAGYeXfXPPO849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EfXOxCrZZpRTTNz1eI=",
            "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtmlY2m89w4hz6NW9Bet17L5jCxxYEJOxY1wLMHlh0zoQs7QUA08fJBZVZn1cCOULqLlBZMRRUOgNDjAa1gul9TbPPtzrNhqd3p9PkfbtA1t0fEV9s2I5HD4WpRd2YlKa12dfyPsyRbICYp0s9J/L5Tvg2jTu3CH0Q+w2DoN80kQH5OsfhnYq9nx1Kj9pnc0ortFaFBzZ1NLeujp8v0/dhFdYgOJ6869dk8QnXbFWojZFa6J8FOo+iOSq3AKemOEt8btP9uM+JRAfTPcDuPg2abaly/CXJHKpb3IpKlXtbZed5Ohr0c6X+FnwvLK39GxpqJrpHXrAMFm6BUS+sENdbwIDAQAB",
            "json",
            "UTF-8",
            "RSA2"
        ]
    }
}

在我的应用类里,Aliconfig 类为空,为什么???求答案

1 回复

看文档,单元测试那个章节

添加回复
请先登陆
回到顶部