Skip to content

Commit

Permalink
Fixing compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Chiu committed Nov 16, 2024
1 parent 5cdb552 commit 2b8c256
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void create() {
templateParams.setSections(Arrays.asList("Bees and me", "Honey for you", "Conclusion"));
LiltCreateContentPreferences preferences = new LiltCreateContentPreferences();
preferences.setTone("formal");
LiltCreateContentRequest requestBody = new LiltCreateContent();
LiltCreateContentRequest requestBody = new LiltCreateContentRequest();
requestBody.setLanguage("en-US");
requestBody.setTemplate("blog-post");
requestBody.setTemplateParams(templateParams);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void create() {
templateParams.setSections(getSections(this.sectionCase));
LiltCreateContentPreferences preferences = new LiltCreateContentPreferences();
preferences.setTone("formal");
LiltCreateContentRequest requestBody = new LiltCreateContent();
LiltCreateContentRequest requestBody = new LiltCreateContentRequest();
requestBody.setLanguage("en-US");
requestBody.setTemplate("blog-post");
requestBody.setTemplateParams(templateParams);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.util.zip.ZipInputStream;
import java.util.zip.ZipEntry;

import org.apache.commons.io.IOUtils;
import org.junit.Test;

public class TestVerifiedTranslate {
Expand All @@ -43,7 +44,7 @@ private void printError(ApiException e) {
e.printStackTrace();
}

public class MonitorJobCreateHandler implements Callable<Integer>{
public class MonitorJobCreateHandler implements Callable<int>{
private final JobsApi jobsApiInstance;
private final int jobId;
private int jobLength;
Expand All @@ -62,7 +63,7 @@ private int monitorJobCreate() {
while (this.jobLength.equals(0)) {
this.jobsApiInstance.deliverJob(this.jobId);
monitorResult = this.jobsApiInstance.retrieveAllJobs(false, true, 0, 25);
this.jobLength = monitorResult.length;
this.jobLength = monitorResult.size();
Thread.sleep(5000);
System.out.println("Job length: " + Integer.toString(this.jobLength) + " || Request No: " + Integer.toString(numMonitored));
numMonitored++;
Expand All @@ -71,7 +72,7 @@ private int monitorJobCreate() {
}
}
assert monitorResult != null;
return monitorResult.length;
return monitorResult.size();
} catch (ApiException e) {
printError(e);
fail("Should be able to monitor job creation");
Expand All @@ -88,7 +89,7 @@ public int call() throws Exception {
}
}

public class MonitorJobExportHandler implements Callable<Integer>{
public class MonitorJobExportHandler implements Callable<int>{
private final JobsApi jobsApiInstance;
private final int jobId;
private int isProcessing;
Expand All @@ -104,7 +105,7 @@ public MonitorJobExportHandler(JobsApi jobsApiInstance, int jobId, int isProcess
private int monitorJobExport() {
try {
Job monitorResult = null;
while (this.isProcessing.equals(1)) {
while (this.isProcessing == 1) {
monitorResult = this.jobsApiInstance.getJob(this.jobId);
this.isProcessing = monitorResult.getIsProcessing();
Thread.sleep(5000);
Expand Down Expand Up @@ -236,7 +237,7 @@ public void translate() {
final Future<String> monitorJobExportHandler = jobExportExecutor.submit(jobExportHandler);
try {
int exportIsProcessing = monitorJobExportHandler.get(120, TimeUnit.SECONDS);
if (exportIsProcessing.equals(1)) {
if (exportIsProcessing == 1) {
System.out.println("Job export exceeding time limit.");
fail("Job export should not timeout");
}
Expand All @@ -251,8 +252,7 @@ public void translate() {
ZipInputStream zip = new ZipInputStream(new ByteArrayInputStream(downloadResult));
ZipEntry zipEntry = zip.getNextEntry();
zipEntry = zip.getNextEntry();
InputStream zipStream = zip.getInputStream(zipEntry);
String zipContents = IOUtils.toString(zipStream, "UTF-8");
String zipContents = IOUtils.toString(zip, "UTF-8");
assertEquals(zipContents, "hello world");
} catch (ApiException e) {
System.err.println("Exception when calling JobsApi#downloadJob");
Expand Down

0 comments on commit 2b8c256

Please sign in to comment.