DefaultPrimer extends Primer { @Override public void primeGrpcAsync() { boolean needsPrime = isGrpcPrimed.compareAndSet(false, true); if (needsPrime) { primeClassNamesResourceAsync(grpcResourcePath); } } DefaultPrimer(); @VisibleForTesting  DefaultPrimer(
      Consumer<String> classloaderStrategy,
      String grpcResourcePath,
      String protobufResourcePath,
      ExecutorService executorService); @Override void primeGrpcAsync(); @Override void primeProtobufAsync(); @Override void primeAllVersionsAsync(); @Override void primeCredentialsAsync(Credentials credentials);  }
@Test public void primeGrpc_loadsClassNamesFromResource_with1entry() { new DefaultPrimer(classloaderStrategy, "/primer/1-entry", "not used", DIRECT_EXECUTOR) .primeGrpcAsync(); verify(classloaderStrategy).accept("1"); }
@Test public void primeGrpc_loadsClassNamesFromResource_with3entries() { new DefaultPrimer(classloaderStrategy, "/primer/3-entries", "not used", DIRECT_EXECUTOR) .primeGrpcAsync(); verify(classloaderStrategy).accept("1"); verify(classloaderStrategy).accept("2"); verify(classloaderStrategy).accept("3"); }
@Test public void primeGrpc_loadsClassNamesFromResource_skipsBlankLines() { new DefaultPrimer( classloaderStrategy, "/primer/2-entries-blankline", "not used", DIRECT_EXECUTOR) .primeGrpcAsync(); verify(classloaderStrategy).accept("1"); verify(classloaderStrategy).accept("2"); }