use of com.thinkbiganalytics.nifi.core.api.metadata.MetadataProviderService in project kylo by Teradata.
the class GetFeedsHistoryReindexTest method testErrorGettingFeedsToReindex.
@Test
public void testErrorGettingFeedsToReindex() throws Exception {
final String METADATA_SERVICE_IDENTIFIER = "MockMetadataProviderService_ErrorGettingFeedsToReindex";
final TestRunner runner = TestRunners.newTestRunner(GetFeedsHistoryReindex.class);
final MetadataProviderService metadataService = new MockMetadataProviderService_ErrorGettingFeedsToReindex();
runner.addControllerService(METADATA_SERVICE_IDENTIFIER, metadataService);
runner.enableControllerService(metadataService);
runner.setProperty(GetFeedsHistoryReindex.METADATA_SERVICE, METADATA_SERVICE_IDENTIFIER);
runner.run(1);
runner.assertQueueEmpty();
runner.assertTransferCount(GetFeedsHistoryReindex.REL_FOUND, 0);
runner.assertTransferCount(GetFeedsHistoryReindex.REL_NOT_FOUND, 0);
runner.assertTransferCount(GetFeedsHistoryReindex.REL_FAILURE, 1);
runner.assertTransferCount(GetFeedsHistoryReindex.REL_ORIGINAL, 0);
List<MockFlowFile> results = runner.getFlowFilesForRelationship(GetFeedsHistoryReindex.REL_FAILURE);
MockFlowFile resultFlowFile = results.get(0);
resultFlowFile.assertAttributeNotExists(GetFeedsHistoryReindex.FEEDS_TOTAL_COUNT_FOR_HISTORY_REINDEX_KEY);
resultFlowFile.assertAttributeNotExists(GetFeedsHistoryReindex.FEEDS_TOTAL_IDS_FOR_HISTORY_REINDEX_KEY);
resultFlowFile.assertAttributeNotExists(GetFeedsHistoryReindex.FEEDS_CHECK_TIME_UTC_FOR_HISTORY_REINDEX_KEY);
}
use of com.thinkbiganalytics.nifi.core.api.metadata.MetadataProviderService in project kylo by Teradata.
the class UpdateFeedHistoryReindexTest method setFeedStatus_ValidStateExpressionLanguage.
@Test
public void setFeedStatus_ValidStateExpressionLanguage() throws Exception {
final String METADATA_SERVICE_IDENTIFIER = "MockMetadataProviderService_Minimal";
final TestRunner runner = TestRunners.newTestRunner(UpdateFeedHistoryReindex.class);
final MetadataProviderService metadataService = new MockMetadataProviderService_Minimal();
runner.addControllerService(METADATA_SERVICE_IDENTIFIER, metadataService);
runner.enableControllerService(metadataService);
runner.setProperty(UpdateFeedHistoryReindex.METADATA_SERVICE, METADATA_SERVICE_IDENTIFIER);
runner.setProperty(UpdateFeedHistoryReindex.FEED_ID, "feed-0-id");
runner.setProperty(UpdateFeedHistoryReindex.FEED_REINDEX_STATUS, "${history.reindex.feed.status.for.update}");
runner.assertValid();
}
use of com.thinkbiganalytics.nifi.core.api.metadata.MetadataProviderService in project kylo by Teradata.
the class UpdateFeedHistoryReindexTest method setFeedStatus_ValidStateCompletedWithSuccess.
@Test
public void setFeedStatus_ValidStateCompletedWithSuccess() throws Exception {
final String METADATA_SERVICE_IDENTIFIER = "MockMetadataProviderService_Minimal";
final TestRunner runner = TestRunners.newTestRunner(UpdateFeedHistoryReindex.class);
final MetadataProviderService metadataService = new MockMetadataProviderService_Minimal();
runner.addControllerService(METADATA_SERVICE_IDENTIFIER, metadataService);
runner.enableControllerService(metadataService);
runner.setProperty(UpdateFeedHistoryReindex.METADATA_SERVICE, METADATA_SERVICE_IDENTIFIER);
runner.setProperty(UpdateFeedHistoryReindex.FEED_ID, "feed-0-id");
runner.setProperty(UpdateFeedHistoryReindex.FEED_REINDEX_STATUS, "COMPLETED_WITH_SUCCESS");
runner.assertValid();
}
use of com.thinkbiganalytics.nifi.core.api.metadata.MetadataProviderService in project kylo by Teradata.
the class UpdateFeedHistoryReindexTest method setFeedStatus_ValidStateCompletedWithFailure.
@Test
public void setFeedStatus_ValidStateCompletedWithFailure() throws Exception {
final String METADATA_SERVICE_IDENTIFIER = "MockMetadataProviderService_Minimal";
final TestRunner runner = TestRunners.newTestRunner(UpdateFeedHistoryReindex.class);
final MetadataProviderService metadataService = new MockMetadataProviderService_Minimal();
runner.addControllerService(METADATA_SERVICE_IDENTIFIER, metadataService);
runner.enableControllerService(metadataService);
runner.setProperty(UpdateFeedHistoryReindex.METADATA_SERVICE, METADATA_SERVICE_IDENTIFIER);
runner.setProperty(UpdateFeedHistoryReindex.FEED_ID, "feed-0-id");
runner.setProperty(UpdateFeedHistoryReindex.FEED_REINDEX_STATUS, "COMPLETED_WITH_FAILURE");
runner.assertValid();
}
use of com.thinkbiganalytics.nifi.core.api.metadata.MetadataProviderService in project kylo by Teradata.
the class UpdateFeedHistoryReindexTest method setFeedStatus_InvalidState.
@Test
public void setFeedStatus_InvalidState() throws Exception {
final String METADATA_SERVICE_IDENTIFIER = "MockMetadataProviderService_Minimal";
final TestRunner runner = TestRunners.newTestRunner(UpdateFeedHistoryReindex.class);
final MetadataProviderService metadataService = new MockMetadataProviderService_Minimal();
runner.addControllerService(METADATA_SERVICE_IDENTIFIER, metadataService);
runner.enableControllerService(metadataService);
runner.setProperty(UpdateFeedHistoryReindex.METADATA_SERVICE, METADATA_SERVICE_IDENTIFIER);
runner.setProperty(UpdateFeedHistoryReindex.FEED_ID, "feed-0-id");
runner.setProperty(UpdateFeedHistoryReindex.FEED_REINDEX_STATUS, "NOT_VALID_STATE");
runner.assertNotValid();
}
Aggregations