umustafi commented on code in PR #3864:
URL: https://github.com/apache/gobblin/pull/3864#discussion_r1462600348


##########
gobblin-service/src/test/java/org/apache/gobblin/service/GobblinServiceManagerTest.java:
##########
@@ -403,34 +425,48 @@ public void testCreateAgain() throws Exception {
     Assert.assertEquals(exception.getStatus(), HttpStatus.CONFLICT_409);
   }
 
+  /*
+  This test adds a new flowConfig to the client checks the config retrieved 
using the getFlowConfig endpoint matches it
+   */
   @Test (dependsOnMethods = "testCreateAgain")
   public void testGet() throws Exception {
-    FlowConfig flowConfig = this.flowConfigClient.getFlowConfig(TEST_FLOW_ID);
+    FlowId flowId = createFlowIdWithUniqueName(TEST_GROUP_NAME);
+    FlowConfig flowConfig = new FlowConfig().setId(flowId)
+        .setTemplateUris(TEST_TEMPLATE_URI).setSchedule(new 
Schedule().setCronSchedule(TEST_SCHEDULE).setRunImmediately(true))
+        .setProperties(new StringMap(flowProperties));
+    this.flowConfigClient.createFlowConfig(flowConfig);
 
-    Assert.assertEquals(flowConfig.getId().getFlowGroup(), TEST_GROUP_NAME);
-    Assert.assertEquals(flowConfig.getId().getFlowName(), TEST_FLOW_NAME);
-    Assert.assertEquals(flowConfig.getSchedule().getCronSchedule(), 
TEST_SCHEDULE);
-    Assert.assertEquals(flowConfig.getTemplateUris(), TEST_TEMPLATE_URI);
-    Assert.assertTrue(flowConfig.getSchedule().isRunImmediately());
+    FlowConfig getFlowConfig = this.flowConfigClient.getFlowConfig(flowId);
+    Assert.assertEquals(getFlowConfig.getId().getFlowGroup(), TEST_GROUP_NAME);
+    Assert.assertEquals(getFlowConfig.getId().getFlowName(), 
flowId.getFlowName());
+    Assert.assertEquals(getFlowConfig.getSchedule().getCronSchedule(), 
TEST_SCHEDULE);
+    Assert.assertEquals(getFlowConfig.getTemplateUris(), TEST_TEMPLATE_URI);
+    Assert.assertTrue(getFlowConfig.getSchedule().isRunImmediately());
     // Add this assert back when getFlowSpec() is changed to return the raw 
flow spec
-    //Assert.assertEquals(flowConfig.getProperties().size(), 1);
-    Assert.assertEquals(flowConfig.getProperties().get("param1"), "value1");
+    //Assert.assertEquals(getFlowConfig.getProperties().size(), 1);
+    Assert.assertEquals(getFlowConfig.getProperties().get("param1"), "value1");
   }
 
-  @Test (dependsOnMethods = "testCreateAgain")
+  /*
+    Adds one more flowConfig to the flowCatalog, checks that the size 
increased, and then deletes the one it just added
+   */
+  @Test (dependsOnMethods = "testGet")
   public void testGetAll() throws Exception {
-    FlowConfig flowConfig2 = new FlowConfig().setId(TEST_FLOW_ID2)
+    int sizeBefore = this.flowConfigClient.getAllFlowConfigs().size();
+    FlowId flowId = createFlowIdWithUniqueName(TEST_GROUP_NAME);
+    FlowConfig flowConfig = new FlowConfig().setId(flowId)
         .setTemplateUris(TEST_TEMPLATE_URI).setSchedule(new 
Schedule().setCronSchedule(TEST_SCHEDULE))
         .setProperties(new StringMap(flowProperties));
-    this.flowConfigClient.createFlowConfig(flowConfig2);
+    this.flowConfigClient.createFlowConfig(flowConfig);
     Collection<FlowConfig> flowConfigs = 
this.flowConfigClient.getAllFlowConfigs();
 
-    Assert.assertEquals(flowConfigs.size(), 2);
+    Assert.assertEquals(flowConfigs.size(), sizeBefore + 1);
 
-    this.flowConfigClient.deleteFlowConfig(TEST_FLOW_ID2);
+    this.flowConfigClient.deleteFlowConfig(flowId);
   }
 
-  @Test (dependsOnMethods = "testCreateAgain", enabled = false)
+  // TODO: re-enable after updating filters
+  @Test (dependsOnMethods = "testGetAll", enabled = false, groups = 
{"disabledOnCI"})

Review Comment:
   need to update the tests to check for flow execution ids that were just 
added. Again want to time box these fixes. I can do if seems useful but this is 
also tested down below in some other tests. 



-- 
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]

Reply via email to