### Question:
WeaverSubscribeOnComponentSingle extends WeaverSubscribeOnComponentAbstract<Single> { @Override public Single build() throws Throwable { return buildComponentInternal(); } WeaverSubscribeOnComponentSingle(ProceedingJoinPoint joinPoint, WeaverComponent<Single> parentWeaverComponent); @Override Single build();  }### Answer:
@Test public void build() throws Throwable { when(proceedingJoinPoint.proceed()).thenReturn(Single.just(1)); when(parentWeaverComponent.getComponentInfo()).thenReturn(componentInfo); when(proceedingJoinPoint.getArgs()).thenReturn(new Object[]{Schedulers.io()}); WeaverSubscribeOnComponentSingle weaverOnSubscribeComponentSingle = new WeaverSubscribeOnComponentSingle(proceedingJoinPoint, parentWeaverComponent); Single single = weaverOnSubscribeComponentSingle.build(); single.subscribe(observer); observer.dispose(); observer.assertComplete(); verify(componentInfo).setSubscribeOnScheduler(anyString()); verify(componentInfo).setSubscribeOnThread(anyString()); }
@Test public void buildWithoutParent() throws Throwable { when(proceedingJoinPoint.proceed()).thenReturn(Single.just(1)); WeaverSubscribeOnComponentSingle weaverOnSubscribeComponentSingle = new WeaverSubscribeOnComponentSingle(proceedingJoinPoint, null); Single single = weaverOnSubscribeComponentSingle.build(); single.subscribe(observer); observer.dispose(); observer.assertComplete(); verify(componentInfo, times(0)).setSubscribeOnScheduler(anyString()); verify(componentInfo, times(0)).setSubscribeOnThread(anyString()); }