Skip to content

CDAP-15860 Facebook Ads (SaaS source) - batch source - #1

Open
YevheniiChekanskyi wants to merge 18 commits into
developfrom
feature/CDAP-15860-facebook-batch-source
Open

CDAP-15860 Facebook Ads (SaaS source) - batch source#1
YevheniiChekanskyi wants to merge 18 commits into
developfrom
feature/CDAP-15860-facebook-batch-source

Conversation

@YevheniiChekanskyi

@YevheniiChekanskyi YevheniiChekanskyi commented Sep 13, 2019

Copy link
Copy Markdown
Owner

JIRA: https://issues.cask.co/browse/CDAP-15860
DOC: https://wiki.cask.co/display/CE/Facebook+Ads

As part of this PR batch source for facebook insights api was created.

Comment thread docs/FacebookAdsBatchSource-batchsource.md Outdated
Comment thread pom.xml Outdated
Comment thread pom.xml Outdated
Comment thread pom.xml Outdated
Comment thread pom.xml Outdated
/**
* Base configuration for facebook sources.
*/
public class BaseSourceConfig extends ReferencePluginConfig {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will facebook have many source plugins?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, streaming source is planned.


DataSetManager<Table> outputManager = getDataset("outputSink");
List<StructuredRecord> outputRecords = MockSink.readOutput(outputManager);
System.out.println();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test code?

workflowManager.startAndWaitForRun(ProgramRunStatus.COMPLETED, 5, TimeUnit.MINUTES);

DataSetManager<Table> outputManager = getDataset("outputSink");
List<StructuredRecord> outputRecords = MockSink.readOutput(outputManager);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any assertions?


@Test
@SuppressWarnings("unchecked")
public void testIterate() throws IOException, APIException {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test is not very readable and maintainable. What about replacing it with functional test?

@@ -0,0 +1,104 @@
{

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like you miss image and docs

Comment thread pom.xml Outdated
<_exportcontents>io.cdap.plugin.facebook.*</_exportcontents>
<Embed-Directory>lib</Embed-Directory>
<!--Only @Plugin classes in the export packages will be included as plugin-->
<_exportcontents>io.cdap.*</_exportcontents>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicated export


public class FacebookBatchSourceConfigTest {

static class FacebookBatchSourceConfigMock extends FacebookBatchSourceConfig {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you use builder like in other plugins?

import org.junit.Test;

public class BaseSourceConfigTest {
static class BaseSourceConfigMock extends BaseSourceConfig {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same question about builder

MockFailureCollector failureCollector = new MockFailureCollector();
config.validateFields(failureCollector);

Assert.assertEquals(1, failureCollector.getValidationFailures().size());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you use validation utils like in other configs? I don't think testing failures count is enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants