SyncDistributedApplianceServiceTest.java 文件源码

java
阅读 24 收藏 0 点赞 0 评论 0

项目:osc-core 作者:
@Before
public void setup() throws Exception {
    MockitoAnnotations.initMocks(this);
    when(this.em.find(eq(DistributedAppliance.class), eq(MARKED_FOR_DELETE_DA_ID)))
           .thenReturn(MARKED_FOR_DELETE_DA);
    when(this.em.find(eq(DistributedAppliance.class), eq(GOOD_DA_ID))).thenReturn(GOOD_DA);
    when(this.jobFactory.startDAConformJob(any(EntityManager.class), any(DistributedAppliance.class)))
           .thenAnswer(new Answer<Long>() {
               @Override
               public Long answer(InvocationOnMock invocation) throws Throwable {
                   DistributedAppliance result = invocation.getArgumentAt(1, DistributedAppliance.class);
                   return result.getId();
               }
           });
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号