Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PipelineModel to fix serialization #577

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
*/
public class PipelineModel {

private final PluginModel sourcePluginModel;
private final List<PluginModel> prepperPluginModel;
private final List<PluginModel> sinkPluginModel;
private final PluginModel source;
private final List<PluginModel> preppers;
private final List<PluginModel> sinks;
private final Integer workers;
private final Integer readBatchDelay;

Expand All @@ -25,23 +25,23 @@ public PipelineModel(
@JsonProperty("sink") final List<PluginModel> sinks,
@JsonProperty("workers") final Integer workers,
@JsonProperty("delay") final Integer delay) {
this.sourcePluginModel = source;
this.prepperPluginModel = preppers;
this.sinkPluginModel = sinks;
this.source = source;
this.preppers = preppers;
this.sinks = sinks;
this.workers = workers;
this.readBatchDelay = delay;
}

public PluginModel getSourcePluginModel() {
return sourcePluginModel;
public PluginModel getSource() {
return source;
}

public List<PluginModel> getPrepperPluginModel() {
return prepperPluginModel;
public List<PluginModel> getPreppers() {
return preppers;
}

public List<PluginModel> getSinkPluginModel() {
return sinkPluginModel;
public List<PluginModel> getSinks() {
return sinks;
}

public Integer getWorkers() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ public void testPipelineModelCreation() {
TEST_WORKERS,
TEST_READ_BATCH_DELAY
);
final PluginModel originalSourcePluginModel = pipelineModel.getSourcePluginModel();
final List<PluginModel> originalPreppersPluginModel = pipelineModel.getPrepperPluginModel();
final List<PluginModel> originalSinksPluginModel = pipelineModel.getSinkPluginModel();
final PluginModel originalSource = pipelineModel.getSource();
final List<PluginModel> originalPreppers = pipelineModel.getPreppers();
final List<PluginModel> originalSinks = pipelineModel.getSinks();

assertThat(originalSourcePluginModel, notNullValue());
assertThat(originalPreppersPluginModel, notNullValue());
assertThat(originalSinksPluginModel, notNullValue());
assertThat(originalSourcePluginModel.getPluginName(), is(equalTo(TEST_VALID_SOURCE_PLUGIN_MODEL.getPluginName())));
assertThat(originalSourcePluginModel.getPluginSettings(), is(equalTo(TEST_VALID_SOURCE_PLUGIN_MODEL.getPluginSettings())));
assertThat(originalPreppersPluginModel.get(0).getPluginName(), is(equalTo(TEST_VALID_PREPPERS_PLUGIN_MODEL.getPluginName())));
assertThat(originalPreppersPluginModel.get(0).getPluginSettings(), is(equalTo(TEST_VALID_PREPPERS_PLUGIN_MODEL.getPluginSettings())));
assertThat(originalSinksPluginModel.get(0).getPluginName(), is(equalTo(TEST_VALID_SINKS_PLUGIN_MODEL.getPluginName())));
assertThat(originalSinksPluginModel.get(0).getPluginSettings(), is(equalTo(TEST_VALID_SINKS_PLUGIN_MODEL.getPluginSettings())));
assertThat(originalSource, notNullValue());
assertThat(originalPreppers, notNullValue());
assertThat(originalSinks, notNullValue());
assertThat(originalSource.getPluginName(), is(equalTo(TEST_VALID_SOURCE_PLUGIN_MODEL.getPluginName())));
assertThat(originalSource.getPluginSettings(), is(equalTo(TEST_VALID_SOURCE_PLUGIN_MODEL.getPluginSettings())));
assertThat(originalPreppers.get(0).getPluginName(), is(equalTo(TEST_VALID_PREPPERS_PLUGIN_MODEL.getPluginName())));
assertThat(originalPreppers.get(0).getPluginSettings(), is(equalTo(TEST_VALID_PREPPERS_PLUGIN_MODEL.getPluginSettings())));
assertThat(originalSinks.get(0).getPluginName(), is(equalTo(TEST_VALID_SINKS_PLUGIN_MODEL.getPluginName())));
assertThat(originalSinks.get(0).getPluginSettings(), is(equalTo(TEST_VALID_SINKS_PLUGIN_MODEL.getPluginSettings())));
assertThat(pipelineModel.getWorkers(), is(TEST_WORKERS));
assertThat(pipelineModel.getReadBatchDelay(), is(TEST_READ_BATCH_DELAY));
}
Expand Down