@Test (dependsOnMethods = "testUpdate") public void testDelete() throws Exception { FlowId flowId = new FlowId().setFlowGroup(TEST_GROUP_NAME).setFlowName(TEST_FLOW_NAME); // make sure flow config exists FlowConfig flowConfig = this.flowConfigClient.getFlowConfig(flowId); Assert.assertEquals(flowConfig.getId().getFlowGroup(), TEST_GROUP_NAME); Assert.assertEquals(flowConfig.getId().getFlowName(), TEST_FLOW_NAME); this.flowConfigClient.deleteFlowConfig(flowId); try { this.flowConfigClient.getFlowConfig(flowId); } catch (RestLiResponseException e) { Assert.assertEquals(e.getStatus(), HttpStatus.NOT_FOUND_404); return; } Assert.fail("Get should have gotten a 404 error"); }
@Test (dependsOnMethods = "testUpdate") public void testDelete() throws Exception { logger.info("+++++++++++++++++++ testDelete START"); FlowId flowId = new FlowId().setFlowGroup(TEST_GROUP_NAME_1).setFlowName(TEST_FLOW_NAME_1); // make sure flow config exists FlowConfig flowConfig = this.node1FlowConfigClient.getFlowConfig(flowId); Assert.assertEquals(flowConfig.getId().getFlowGroup(), TEST_GROUP_NAME_1); Assert.assertEquals(flowConfig.getId().getFlowName(), TEST_FLOW_NAME_1); this.node1FlowConfigClient.deleteFlowConfig(flowId); // Check if deletion is reflected on both nodes try { this.node1FlowConfigClient.getFlowConfig(flowId); Assert.fail("Get should have gotten a 404 error"); } catch (RestLiResponseException e) { Assert.assertEquals(e.getStatus(), HttpStatus.NOT_FOUND_404); } try { this.node2FlowConfigClient.getFlowConfig(flowId); Assert.fail("Get should have gotten a 404 error"); } catch (RestLiResponseException e) { Assert.assertEquals(e.getStatus(), HttpStatus.NOT_FOUND_404); } logger.info("+++++++++++++++++++ testDelete END"); }
@Test (dependsOnMethods = "testUpdate") public void testDelete() throws Exception { FlowId flowId = new FlowId().setFlowGroup(TEST_GROUP_NAME).setFlowName(TEST_FLOW_NAME); // make sure flow config exists FlowConfig flowConfig = _client.getFlowConfig(flowId); Assert.assertEquals(flowConfig.getId().getFlowGroup(), TEST_GROUP_NAME); Assert.assertEquals(flowConfig.getId().getFlowName(), TEST_FLOW_NAME); _client.deleteFlowConfig(flowId); try { _client.getFlowConfig(flowId); } catch (RestLiResponseException e) { Assert.assertEquals(e.getStatus(), HttpStatus.S_404_NOT_FOUND.getCode()); return; } Assert.fail("Get should have gotten a 404 error"); }