ProcessorSchemaV1 extends BaseSchema implements ConvertableSchema<ProcessorSchema> { @Override public ProcessorSchema convert() { Map<String, Object> map = new HashMap<>(); map.put(NAME_KEY, name); map.put(CLASS_KEY, processorClass); map.put(MAX_CONCURRENT_TASKS_KEY, maxConcurrentTasks); map.put(SCHEDULING_STRATEGY_KEY, schedulingStrategy); map.put(SCHEDULING_PERIOD_KEY, schedulingPeriod); map.put(PENALIZATION_PERIOD_KEY, penalizationPeriod); map.put(YIELD_PERIOD_KEY, yieldPeriod); map.put(RUN_DURATION_NANOS_KEY, runDurationNanos); map.put(AUTO_TERMINATED_RELATIONSHIPS_LIST_KEY, autoTerminatedRelationshipsList); map.put(PROPERTIES_KEY, new HashMap<>(properties)); return new ProcessorSchema(map); } ProcessorSchemaV1(Map map); @Override ProcessorSchema convert(); String getName(); @Override int getVersion();  }
@Test public void testProcessorClass() { assertEquals(testProcessorClass, createSchema(0).convert().getProcessorClass()); }
@Test public void testNoProcessorClass() { Map<String, Object> map = createMap(); map.remove(CLASS_KEY); assertNull(createSchema(map, 1).convert().getProcessorClass()); }
@Test public void testSchedulingStrategy() { assertEquals(testSchedulingStrategy, createSchema(0).convert().getSchedulingStrategy()); }
@Test public void testNoSchedulingStrategy() { Map<String, Object> map = createMap(); map.remove(SCHEDULING_STRATEGY_KEY); assertNull(createSchema(map, 1).convert().getSchedulingStrategy()); }
@Test public void testInvalidSchedulingStrategy() { testSchedulingStrategy = "fake strategy"; assertEquals(testSchedulingStrategy, createSchema(1).convert().getSchedulingStrategy()); }
@Test public void testSchedulingPeriod() { assertEquals(testSchedulingPeriod, createSchema(0).convert().getSchedulingPeriod()); }
@Test public void testNoSchedulingPeriod() { Map<String, Object> map = createMap(); map.remove(SCHEDULING_PERIOD_KEY); assertNull(createSchema(map, 1).convert().getSchedulingPeriod()); }
@Test public void testMaxConcurrentTasks() { assertEquals(testMaxConcurrentTasks, createSchema(0).convert().getMaxConcurrentTasks()); }
@Test public void testNoMaxConcurrentTasks() { Map<String, Object> map = createMap(); map.remove(MAX_CONCURRENT_TASKS_KEY); assertEquals(DEFAULT_MAX_CONCURRENT_TASKS, createSchema(map, 0).convert().getMaxConcurrentTasks()); }
@Test public void testPenalizationPeriod() { assertEquals(testPenalizationPeriod, createSchema(0).convert().getPenalizationPeriod()); }
@Test public void testNoPenalizationPeriod() { Map<String, Object> map = createMap(); map.remove(PENALIZATION_PERIOD_KEY); assertEquals(DEFAULT_PENALIZATION_PERIOD, createSchema(map, 0).convert().getPenalizationPeriod()); }
@Test public void testYieldPeriod() { assertEquals(testYieldPeriod, createSchema(0).convert().getYieldPeriod()); }
@Test public void testNoYieldPeriod() { Map<String, Object> map = createMap(); map.remove(YIELD_PERIOD_KEY); assertEquals(DEFAULT_YIELD_DURATION, createSchema(map, 0).convert().getYieldPeriod()); }
@Test public void testRunDurationNanos() { assertEquals(testRunDurationNanos, createSchema(0).convert().getRunDurationNanos()); }
@Test public void testNoRunDurationNanos() { Map<String, Object> map = createMap(); map.remove(RUN_DURATION_NANOS_KEY); assertEquals(DEFAULT_RUN_DURATION_NANOS, createSchema(map, 0).convert().getRunDurationNanos()); }
@Test public void testAutoTerminatedRelationships() { assertEquals(testAutoTerminatedRelationships, createSchema(0).convert().getAutoTerminatedRelationshipsList()); }
@Test public void testNoAutoTerminatedRelationships() { Map<String, Object> map = createMap(); map.remove(AUTO_TERMINATED_RELATIONSHIPS_LIST_KEY); assertEquals(DEFAULT_AUTO_TERMINATED_RELATIONSHIPS_LIST, createSchema(map, 0).convert().getAutoTerminatedRelationshipsList()); }
@Test public void testProperties() { assertEquals(testProperties, createSchema(0).convert().getProperties()); }
@Test public void testNoProperties() { Map<String, Object> map = createMap(); map.remove(PROPERTIES_KEY); assertEquals(DEFAULT_PROPERTIES, createSchema(map, 0).convert().getProperties()); }