ConnectionSchema extends BaseSchemaWithIdAndName { @Override public Map<String, Object> toMap() { Map<String, Object> result = super.toMap(); result.put(SOURCE_ID_KEY, sourceId); result.put(SOURCE_RELATIONSHIP_NAMES_KEY, sourceRelationshipNames); result.put(DESTINATION_ID_KEY, destinationId); result.put(MAX_WORK_QUEUE_SIZE_KEY, maxWorkQueueSize); result.put(MAX_WORK_QUEUE_DATA_SIZE_KEY, maxWorkQueueDataSize); result.put(FLOWFILE_EXPIRATION__KEY, flowfileExpiration); result.put(QUEUE_PRIORITIZER_CLASS_KEY, queuePrioritizerClass); return result; } ConnectionSchema(Map map); @Override Map<String, Object> toMap(); String getSourceId(); void setSourceId(String sourceId); String getDestinationId(); void setDestinationId(String destinationId); List<String> getSourceRelationshipNames(); Number getMaxWorkQueueSize(); String getMaxWorkQueueDataSize(); String getFlowfileExpiration(); String getQueuePrioritizerClass(); void setNeedsSourceRelationships(boolean needsSourceRelationships); @Override List<String> getValidationIssues(); static final String SOURCE_ID_KEY; static final String SOURCE_RELATIONSHIP_NAMES_KEY; static final String DESTINATION_ID_KEY; static final String MAX_WORK_QUEUE_SIZE_KEY; static final String MAX_WORK_QUEUE_DATA_SIZE_KEY; static final String FLOWFILE_EXPIRATION__KEY; static final String QUEUE_PRIORITIZER_CLASS_KEY; static final long DEFAULT_MAX_WORK_QUEUE_SIZE; static final String DEFAULT_MAX_QUEUE_DATA_SIZE; static final String DEFAULT_FLOWFILE_EXPIRATION; }
@Test public void testIdKey() { ConnectionSchema schema = createSchema(0); assertEquals(testId, schema.getId()); assertEquals(schema.getId(), schema.toMap().get(CommonPropertyKeys.ID_KEY)); }
@Test public void testNoId() { Map<String, Object> map = createMap(); map.remove(CommonPropertyKeys.ID_KEY); ConnectionSchema schema = createSchema(map, 1); assertEquals("", schema.getId()); assertEquals(schema.getId(), schema.toMap().get(CommonPropertyKeys.ID_KEY)); }
@Test public void testName() { ConnectionSchema schema = createSchema(0); assertEquals(testName, schema.getName()); assertEquals(schema.getName(), schema.toMap().get(CommonPropertyKeys.NAME_KEY)); }
@Test public void testNoName() { Map<String, Object> map = createMap(); map.remove(CommonPropertyKeys.NAME_KEY); ConnectionSchema schema = createSchema(map, 0); assertEquals("", schema.getName()); assertEquals(schema.getName(), schema.toMap().get(CommonPropertyKeys.NAME_KEY)); }