use of org.apache.pulsar.functions.worker.rest.api.FunctionsImpl in project incubator-pulsar by apache.
the class FunctionApiV2ResourceTest method setup.
@BeforeMethod
public void setup() {
this.mockedManager = mock(FunctionMetaDataManager.class);
this.mockedInputStream = mock(InputStream.class);
this.mockedFormData = mock(FormDataContentDisposition.class);
this.mockedNamespace = mock(Namespace.class);
this.mockedWorkerService = mock(WorkerService.class);
when(mockedWorkerService.getFunctionMetaDataManager()).thenReturn(mockedManager);
when(mockedWorkerService.getDlogNamespace()).thenReturn(mockedNamespace);
// worker config
WorkerConfig workerConfig = new WorkerConfig().setWorkerId("test").setWorkerPort(8080).setDownloadDirectory("/tmp/pulsar/functions").setFunctionMetadataTopicName("pulsar/functions").setNumFunctionPackageReplicas(3).setPulsarServiceUrl("pulsar://localhost:6650/");
when(mockedWorkerService.getWorkerConfig()).thenReturn(workerConfig);
this.resource = spy(new FunctionsImpl(() -> mockedWorkerService));
}
Aggregations