Skip to content

Commit

Permalink
[yegor256#1207] Remove DateFormatUtils and replace RandomString
Browse files Browse the repository at this point in the history
  • Loading branch information
pnatashap committed Feb 23, 2024
1 parent 5e0670f commit bcba48a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/main/java/com/rultor/agents/github/StartsTalks.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,10 @@
import java.io.IOException;
import java.net.HttpURLConnection;
import java.util.Collection;
import java.util.Date;
import java.util.LinkedList;
import javax.json.JsonObject;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.apache.commons.lang3.time.DateUtils;
import org.xembly.Directives;

/**
Expand Down Expand Up @@ -85,7 +83,7 @@ public StartsTalks(final Github ghub) {
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
public void execute(final Talks talks) throws IOException {
final String since = new Time(
DateUtils.addMinutes(new Date(), -3)
System.currentTimeMillis() - 180_000
).iso();
final Request req = this.github.entry()
.uri().path("/notifications").back();
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/com/rultor/agents/twitter/TweetsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import com.jcabi.github.mock.MkGithub;
import com.rultor.spi.Talk;
import java.io.IOException;
import org.apache.commons.lang3.RandomStringUtils;
import java.util.UUID;
import org.cactoos.iterable.Mapped;
import org.cactoos.text.Joined;
import org.junit.jupiter.api.Test;
Expand All @@ -58,7 +58,7 @@ final class TweetsTest {
void postsTweet() throws Exception {
final Repo repo = new MkGithub().repos().create(
new Repos.RepoCreate(
RandomStringUtils.randomAlphanumeric(20), false
UUID.randomUUID().toString().replace("-", ""), false
)
);
final Twitter twitter = Mockito.mock(Twitter.class);
Expand All @@ -77,7 +77,7 @@ void postsTweet() throws Exception {
void postsTweetWithLanguages() throws Exception {
final Repo repo = new MkGithub().repos().create(
new Repos.RepoCreate(
RandomStringUtils.randomAlphanumeric(20), false
UUID.randomUUID().toString().replace("-", ""), false
)
);
final Twitter twitter = Mockito.mock(Twitter.class);
Expand Down

0 comments on commit bcba48a

Please sign in to comment.