import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
-import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.invocation.InvocationOnMock;
@Mock
private HttpServletResponse httpResponse;
- @InjectMocks
private JobManager jobManager;
private List<VnfInfo> vnfs = new ArrayList<>();
public void initMocks() throws Exception {
ReflectionTestUtils.setField(JobManager.class, "logger", logger);
when(vnfApi.vnfsGet(NOKIA_LCM_API_VERSION)).thenReturn(buildObservable(vnfs));
- when(selfRegistrationManager.isReady()).thenReturn(true);
+ when(selfRegistrationManagerForVfc.isReady()).thenReturn(true);
+ jobManager = new JobManager(cbamRestApiProviderForVfc, selfRegistrationManagerForVfc);
}
/**
@Test
public void noJobCanBeStartedIfRegistrationNotFinished() throws Exception {
//given
- when(selfRegistrationManager.isReady()).thenReturn(false);
+ when(selfRegistrationManagerForVfc.isReady()).thenReturn(false);
//when
try {
jobManager.spawnJob(VNF_ID, httpResponse);