GRPCExporterProvider extends ModuleProvider { @Override public void notifyAfterCompleted() throws ServiceNotProvidedException, ModuleStartException { exporter.initSubscriptionList(); }  @Override String name(); @Override Class<? extends ModuleDefine> module(); @Override ModuleConfig createConfigBeanIfAbsent(); @Override void prepare(); @Override void start(); @Override void notifyAfterCompleted(); @Override String[] requiredModules();  }
@Test public void notifyAfterCompleted() throws ServiceNotProvidedException, ModuleStartException { GRPCExporter exporter = mock(GRPCExporter.class); ModuleManager manager = mock(ModuleManager.class); ModuleProviderHolder providerHolder = mock(ModuleProviderHolder.class); ModuleServiceHolder serviceHolder = mock(ModuleServiceHolder.class); when(manager.find(CoreModule.NAME)).thenReturn(providerHolder); when(providerHolder.provider()).thenReturn(serviceHolder); doNothing().when(exporter).initSubscriptionList(); grpcExporterProvider.setManager(manager); Whitebox.setInternalState(grpcExporterProvider, "exporter", exporter); grpcExporterProvider.notifyAfterCompleted(); }