Skip to content

Commit

Permalink
feat: ExportFormat test
Browse files Browse the repository at this point in the history
  • Loading branch information
Nolife999 committed Nov 27, 2023
1 parent 8c7509c commit 429bee7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void execute(SendResponse resp) throws ArcException {

// binary transfer
ServiceDao.execQueryExportDataToResponse(resp.getWr(),
ViewEnum.normalizeTableName(arcClientIdentifier.getClient()), this.arcClientIdentifier.getFormat().equals(ExportFormat.CSV_GZIP.getFormat()));
ViewEnum.normalizeTableName(arcClientIdentifier.getClient()), ExportFormat.isCsv(this.arcClientIdentifier.getFormat()));

if (this.clientDao.isWebServiceNotPending()) {
this.clientDao.dropTable(arcClientIdentifier.getClient());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,9 @@ private ExportFormat(String format)
public String getFormat() {
return format;
}

public static boolean isCsv(String clientFormat) {
return clientFormat.equals(CSV_GZIP.toString());
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package fr.insee.arc.ws.services.importServlet.bo;

import static org.junit.Assert.*;

import org.junit.Test;

public class ExportFormatTest {

@Test
public void isCsv() {
assertFalse(ExportFormat.isCsv(ExportFormat.BINARY.toString()));
assertTrue(ExportFormat.isCsv(ExportFormat.CSV_GZIP.toString()));
}

}

0 comments on commit 429bee7

Please sign in to comment.