Alfresco过程服务-单元/集成测试

问题描述

我正在使用Alfresco Process Service进行工作流管理。

我创建了自定义工作流,在其中使用服务“任务操作”。 我已经为该服务任务创建了JavaDelegate,并且正在运行。 我的问题如何为JavaDelegate创建Junit /集成测试。

我正在附上我尝试过的代码

出现依赖注入错误

首先,它给出了EndPointService依赖项注入的错误,但是在@Bean的帮助下,我能够解决该问题,但是它再次给出了EndPointService内部使用的依赖项错误

@Component("searchRecord")
public class SearchRecord implements JavaDelegate {

    @Autowired
    private EndpointService endPointService;
}



@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class SearchRecordTest {

    @Configuration
    static class ContextConfiguration {
        @Bean
        public SearchRecord searchRecord() {
            return new SearchRecord();
        }
    @Bean 
    public EndPointService endPointServiceImpl() 
        { 
            return new EndPointServiceImpl(); 
        }
    }

    @InjectMocks
    @Spy
    private static SearchRecord searchRecord;

    @Mock
    private DelegateExecution execution;

    @Before
    public void initMocks() {
        MockitoAnnotations.initMocks(this);
    }
    @Test
    public void test() throws Exception {   
    }
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)