pratapaditya04 commented on code in PR #3978:
URL: https://github.com/apache/gobblin/pull/3978#discussion_r1650632758
##########
gobblin-runtime/src/test/java/org/apache/gobblin/runtime/spec_store/MysqlSpecStoreTest.java:
##########
@@ -215,6 +246,60 @@ public void testGetSpec() throws Exception {
Assert.assertEquals(specs.size(), 1);
Assert.assertTrue(specs.contains(this.flowSpec4));
}
+ @Test
+ public void testGetSpecsAfterUpdate() throws Exception {
+ this.specStore.addSpec(this.flowSpec5);
+ FlowSpec result = (FlowSpec) this.specStore.getSpec(this.uri5);
+ removeModificationTimestampFromSpecs(result);
+ Assert.assertEquals(result, this.flowSpec5);
+ // Updating flowSpec5
+ this.specStore.addSpec(this.flowSpec5Updated);
+
+ FlowSpecSearchObject flowSpecSearchObject =
FlowSpecSearchObject.builder().flowGroup("fg5").build();
+ Collection<Spec> specs = this.specStore.getSpecs(flowSpecSearchObject);
+ Assert.assertTrue(specs.contains(this.flowSpec5Updated));
+
+ flowSpecSearchObject =
FlowSpecSearchObject.builder().flowName("fn5").build();
+ specs = this.specStore.getSpecs(flowSpecSearchObject);
+ Assert.assertTrue(specs.contains(this.flowSpec5Updated));
+
+ flowSpecSearchObject =
FlowSpecSearchObject.builder().flowName("fn5").flowGroup("fg5").build();
+ specs = this.specStore.getSpecs(flowSpecSearchObject);
+ Assert.assertEquals(specs.size(), 1);
+ Assert.assertTrue(specs.contains(this.flowSpec5Updated));
Review Comment:
addressed
##########
gobblin-runtime/src/test/java/org/apache/gobblin/runtime/spec_store/MysqlSpecStoreTest.java:
##########
@@ -215,6 +246,60 @@ public void testGetSpec() throws Exception {
Assert.assertEquals(specs.size(), 1);
Assert.assertTrue(specs.contains(this.flowSpec4));
}
+ @Test
+ public void testGetSpecsAfterUpdate() throws Exception {
+ this.specStore.addSpec(this.flowSpec5);
+ FlowSpec result = (FlowSpec) this.specStore.getSpec(this.uri5);
+ removeModificationTimestampFromSpecs(result);
+ Assert.assertEquals(result, this.flowSpec5);
+ // Updating flowSpec5
+ this.specStore.addSpec(this.flowSpec5Updated);
+
+ FlowSpecSearchObject flowSpecSearchObject =
FlowSpecSearchObject.builder().flowGroup("fg5").build();
+ Collection<Spec> specs = this.specStore.getSpecs(flowSpecSearchObject);
+ Assert.assertTrue(specs.contains(this.flowSpec5Updated));
+
+ flowSpecSearchObject =
FlowSpecSearchObject.builder().flowName("fn5").build();
+ specs = this.specStore.getSpecs(flowSpecSearchObject);
+ Assert.assertTrue(specs.contains(this.flowSpec5Updated));
Review Comment:
addressed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]