-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CXFLW-993 CXFLW-1128 documentation and added zip utils test case (#1308)
- Loading branch information
1 parent
2864984
commit 857f7a9
Showing
8 changed files
with
69 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/test/java/com/checkmarx/flow/cucumber/integration/ziputils/RunZipUtilsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.checkmarx.flow.cucumber.integration.ziputils; | ||
|
||
import io.cucumber.junit.Cucumber; | ||
import io.cucumber.junit.CucumberOptions; | ||
import org.junit.runner.RunWith; | ||
|
||
@RunWith(Cucumber.class) | ||
@CucumberOptions(plugin = { "pretty", "summary", "html:build/integration/ziputils", "json:build/cucumber/features/integration/ziputils" }, | ||
features = "src/test/resources/cucumber/features", | ||
glue = { "com.checkmarx.flow.cucumber.integration.ziputils"}, | ||
tags = "@Ziputils and @Integration and not @Skip") | ||
public class RunZipUtilsTest { | ||
} |
37 changes: 37 additions & 0 deletions
37
src/test/java/com/checkmarx/flow/cucumber/integration/ziputils/zipUtilsSteps.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.checkmarx.flow.cucumber.integration.ziputils; | ||
|
||
import com.checkmarx.flow.utils.ZipUtils; | ||
import io.cucumber.java.en.And; | ||
import io.cucumber.java.en.When; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.junit.Test; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
@Slf4j | ||
public class zipUtilsSteps { | ||
|
||
|
||
@When("Creating zip File at a time") | ||
public void testZipFileSuccess() throws IOException { | ||
// Creating Zip File | ||
ZipUtils zipService = new ZipUtils(); | ||
File zippedFile = zipService.zipToTempFile(".",""); | ||
|
||
// Checking presence of zip file | ||
assertTrue(zippedFile.exists()); | ||
assertTrue(zippedFile.length() >= 1); // Adjust based on size of your file | ||
|
||
// Deleting zip file | ||
boolean deleted = zippedFile.delete(); | ||
|
||
if (deleted) { | ||
log.info("File successfully deleted!"); | ||
} else { | ||
log.info("Error deleting file."); | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/test/resources/cucumber/features/ziputils/ziputils.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@Ziputils | ||
@Integration | ||
Feature: Zipping files | ||
|
||
Scenario: Zip a file created and deleted successfully | ||
When Creating zip File at a time | ||
|
||
|
||
|