2017-08-18 25 views
0

这是代码。我正在使用黄瓜和guice。我想使用龙目岛。我正在使用java 8如何使用龙虾与黄瓜和guice

@ScenarioScoped 
public class VolumeCreateTestSteps { 
private final VolumeSummaryPage volumeSummaryPage; 
private final VolumeCreateTabs volumeCreateTabs; 
private final VolumeCreatePropertyTab volumeCreatePropertyTab; 

@Inject 
public VolumeCreateTestSteps(VolumeSummaryPage volumeSummaryPage, 
          VolumeCreateTabs volumeCreateTabs, 
          VolumeCreatePropertyTab volumeCreatePropertyTab) { 
    this.volumeSummaryPage = volumeSummaryPage; 
    this.volumeCreateTabs = volumeCreateTabs; 
    this.volumeCreatePropertyTab = volumeCreatePropertyTab; 
} 

回答

0

对黄瓜不了解,但是Lombok + Guice一起工作得很好。语法是相当哈克:使用一个未定义的注解名“两个下划线”

@ScenarioScoped 
@RequiredArgsConstructor([email protected]__(@Inject)) 
public class VolumeCreateTestSteps { 
    private final VolumeSummaryPage volumeSummaryPage; 
    private final VolumeCreateTabs volumeCreateTabs; 
    private final VolumeCreatePropertyTab volumeCreatePropertyTab; 
} 

这个有趣的[email protected]__(@Inject)是一个主要的黑客攻击,但它为我工作,因为Java 5的现在,我使用的龙目岛12年1月16日与Java的8.我想,对Java 9,出现了问题,所以newest Lombok version使用不同的黑客:

[email protected] 

注意尾随下划线。