Skip to content

Commit

Permalink
parameters now are generated as epoch timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
cheshi-mantu committed Mar 26, 2024
1 parent 96990bb commit 77833b7
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/test/java/io/qameta/allure/IssuesRestTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Tags;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;

import java.util.Date;
import java.util.stream.Stream;

import static io.qameta.allure.Allure.parameter;

@Layer("rest")
Expand All @@ -23,12 +27,18 @@ public class IssuesRestTest {
@Microservice("Repository")
@Tags({@Tag("web"), @Tag("regress"), @Tag("second-pipe")})
@ParameterizedTest(name = "Close issue via api")
@ValueSource(strings = {"First Note", "Second Note", "Third Note", "Fourth note"})
public void shouldDeleteUserNote(@Param(value = "Title", excluded = true) String title) {
@MethodSource("epochTimestamps")
public void shouldDeleteUserNote(@Param(value = "Title", excluded = true) long epochTimestamp) {
// public void shouldDeleteUserNote(@Param(mode = Parameter.Mode.) String title) {
steps.createIssueWithTitle(OWNER, REPO, title);
steps.closeIssueWithTitle(OWNER, REPO, title);
Date date = new Date(epochTimestamp);
String note = date.toString();
steps.createIssueWithTitle(OWNER, REPO, note);
steps.closeIssueWithTitle(OWNER, REPO, note);
}
static Stream<Long> epochTimestamps() {
long epochOne = System.currentTimeMillis();
long epochTwo = System.currentTimeMillis() + 1000000; // Adding 1000 seconds for the second timestamp
return Stream.of(epochOne, epochTwo);
}


}

0 comments on commit 77833b7

Please sign in to comment.