@Test public void testPersistenceConveyorYamlSettersCall() throws Exception { environmentVariables.set("conveyor.c10_1.supplier", this.getClass().getName()+".mockConveyor"); ConveyorConfiguration.build("classpath:test10.yml"); verify(mockConveyor,times(1)).setName("c10_1"); verify(mockConveyor,times(1)).setIdleHeartBeat(Duration.ofMillis(1500)); verify(mockConveyor,times(1)).setDefaultBuilderTimeout(Duration.ofMillis(1000)); verify(mockConveyor,times(1)).rejectUnexpireableCartsOlderThan(Duration.ofMillis(10000)); verify(mockConveyor,times(1)).resultConsumer(any(ResultConsumer.class)); verify(mockConveyor,times(1)).scrapConsumer(any(ScrapConsumer.class)); verify(mockConveyor,times(1)).setOnTimeoutAction(any()); verify(mockConveyor,times(1)).setBuilderSupplier(any(BuilderSupplier.class)); verify(mockConveyor,times(1)).setReadinessEvaluator(any(BiPredicate.class)); verify(mockConveyor,times(2)).resultConsumer(); verify(mockConveyor,times(1)).scrapConsumer(); verify(mockConveyor,times(1)).acceptLabels(any()); verify(mockConveyor,times(2)).staticPart(); verify(mockConveyor,times(1)).setDefaultCartConsumer(any()); verify(mockConveyor,times(2)).addCartBeforePlacementValidator(any()); verify(mockConveyor,times(1)).addBeforeKeyEvictionAction(any()); verify(mockConveyor,times(1)).addBeforeKeyReschedulingAction(any()); verify(mockConveyor,times(1)).enablePostponeExpiration(false); verify(mockConveyor,times(1)).enablePostponeExpirationOnTimeout(false); verify(mockConveyor,times(1)).setExpirationPostponeTime(Duration.ofMillis(1000)); verify(mockConveyor,times(1)).setAutoAcknowledge(true); verify(mockConveyor,times(1)).autoAcknowledgeOnStatus(Status.READY, Status.TIMED_OUT, Status.CANCELED); verify(mockConveyor,times(1)).setCartPayloadAccessor(any()); }
public static void build(String conf, String... moreConf) throws Exception { Objects.requireNonNull(conf, "At least one configuration file must be provided"); processConfFile(conf); if (moreConf != null) { for (String file : moreConf) { processConfFile(file); } } Conveyor<String, String, Conveyor> buildingConveyor = getBuildingConveyor(); Map<String,String> env = System.getenv(); env.forEach((key,value)->{ processPair(buildingConveyor, key, value); }); Properties p = System.getProperties(); p.forEach((key,value)->{ processPair(buildingConveyor, ""+key, ""+value); }); buildingConveyor.part().foreach().label("complete_configuration").value(true).place(); buildingConveyor.completeAndStop().get(); Conveyor.unRegister(buildingConveyor.getName()); }
ConveyorConfiguration { public static void build(String conf, String... moreConf) throws Exception { Objects.requireNonNull(conf, "At least one configuration file must be provided"); processConfFile(conf); if (moreConf != null) { for (String file : moreConf) { processConfFile(file); } } Conveyor<String, String, Conveyor> buildingConveyor = getBuildingConveyor(); Map<String,String> env = System.getenv(); env.forEach((key,value)->{ processPair(buildingConveyor, key, value); }); Properties p = System.getProperties(); p.forEach((key,value)->{ processPair(buildingConveyor, ""+key, ""+value); }); buildingConveyor.part().foreach().label("complete_configuration").value(true).place(); buildingConveyor.completeAndStop().get(); Conveyor.unRegister(buildingConveyor.getName()); } }
ConveyorConfiguration { public static void build(String conf, String... moreConf) throws Exception { Objects.requireNonNull(conf, "At least one configuration file must be provided"); processConfFile(conf); if (moreConf != null) { for (String file : moreConf) { processConfFile(file); } } Conveyor<String, String, Conveyor> buildingConveyor = getBuildingConveyor(); Map<String,String> env = System.getenv(); env.forEach((key,value)->{ processPair(buildingConveyor, key, value); }); Properties p = System.getProperties(); p.forEach((key,value)->{ processPair(buildingConveyor, ""+key, ""+value); }); buildingConveyor.part().foreach().label("complete_configuration").value(true).place(); buildingConveyor.completeAndStop().get(); Conveyor.unRegister(buildingConveyor.getName()); } private  ConveyorConfiguration(); }
ConveyorConfiguration { public static void build(String conf, String... moreConf) throws Exception { Objects.requireNonNull(conf, "At least one configuration file must be provided"); processConfFile(conf); if (moreConf != null) { for (String file : moreConf) { processConfFile(file); } } Conveyor<String, String, Conveyor> buildingConveyor = getBuildingConveyor(); Map<String,String> env = System.getenv(); env.forEach((key,value)->{ processPair(buildingConveyor, key, value); }); Properties p = System.getProperties(); p.forEach((key,value)->{ processPair(buildingConveyor, ""+key, ""+value); }); buildingConveyor.part().foreach().label("complete_configuration").value(true).place(); buildingConveyor.completeAndStop().get(); Conveyor.unRegister(buildingConveyor.getName()); } private  ConveyorConfiguration(); static void build(String conf, String... moreConf); @Override String toString(); }
ConveyorConfiguration { public static void build(String conf, String... moreConf) throws Exception { Objects.requireNonNull(conf, "At least one configuration file must be provided"); processConfFile(conf); if (moreConf != null) { for (String file : moreConf) { processConfFile(file); } } Conveyor<String, String, Conveyor> buildingConveyor = getBuildingConveyor(); Map<String,String> env = System.getenv(); env.forEach((key,value)->{ processPair(buildingConveyor, key, value); }); Properties p = System.getProperties(); p.forEach((key,value)->{ processPair(buildingConveyor, ""+key, ""+value); }); buildingConveyor.part().foreach().label("complete_configuration").value(true).place(); buildingConveyor.completeAndStop().get(); Conveyor.unRegister(buildingConveyor.getName()); } private  ConveyorConfiguration(); static void build(String conf, String... moreConf); @Override String toString(); static String SCRIPT_ENGINE; static String PROPERTY_PREFIX; static String PERSISTENCE_PREFIX; static String PROPERTY_DELIMITER; static long DEFAULT_TIMEOUT_MSEC; }