liugddx commented on code in PR #8442: URL: https://github.com/apache/seatunnel/pull/8442#discussion_r1902844635
########## seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/java/org/apache/seatunnel/engine/e2e/RestApiIT.java: ########## @@ -1021,6 +1033,27 @@ public void verifyHtmlResponseBasic() { }); } + @Test + public void testFileSubmitJob() throws IOException { + HttpClient httpClient = HttpClients.createDefault(); + HttpPost uploadFile = + new HttpPost(HOST + PORT + RestConstant.REST_URL_SUBMIT_JOB_BY_UPLOAD_FILE); + MultipartEntityBuilder builder = MultipartEntityBuilder.create(); + builder.setContentType(ContentType.MULTIPART_FORM_DATA); + URL resource = this.getClass().getClassLoader().getResource("upload-file"); + File fileDirect = new File(resource.getFile()); + if (fileDirect.exists() && fileDirect.isDirectory()) { + File[] files = fileDirect.listFiles(); + for (File file : files) { + builder.addPart("config_file", new FileBody(file)); + HttpEntity multipart = builder.build(); + uploadFile.setEntity(multipart); + int statusCode = httpClient.execute(uploadFile).getStatusLine().getStatusCode(); + Assertions.assertEquals(200, statusCode); Review Comment: Add test cases in ClusterSeaTunnelEngineContainer -- 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: commits-unsubscr...@seatunnel.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org