Skip to content

Commit

Permalink
fix test executions
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyraymond committed Dec 21, 2021
1 parent 7a92838 commit c6b347b
Show file tree
Hide file tree
Showing 82 changed files with 127 additions and 132 deletions.
8 changes: 1 addition & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>org.araymond.joal</groupId>
<artifactId>jack-of-all-trades</artifactId>
<version>2.1.28</version>
<version>2.1.29</version>
<packaging>jar</packaging>

<name>jack-of-all-trades</name>
Expand Down Expand Up @@ -145,12 +145,6 @@
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<!-- Version inherited from spring-boot-starter-test -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import org.araymond.joal.core.torrent.torrent.InfoHash;
import org.araymond.joal.core.ttorrent.client.ConnectionHandler;
import org.araymond.joal.core.ttorrent.client.ConnectionHandlerTest;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.io.File;
import java.nio.file.Files;
Expand Down
3 changes: 1 addition & 2 deletions src/test/java/org/araymond/joal/conf/SpringConfTest.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package org.araymond.joal.conf;

import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.core.task.TaskExecutor;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;

public class SpringConfTest {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.araymond.joal.core;

import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.io.IOException;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.araymond.joal.core.bandwith;

import org.araymond.joal.core.torrent.torrent.InfoHash;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;

import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.araymond.joal.core.bandwith;

import org.araymond.joal.core.config.AppConfiguration;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;

import java.util.Set;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.araymond.joal.core.bandwith;

import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.araymond.joal.core.bandwith.Peers;
import org.assertj.core.data.Offset;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.araymond.joal.core.bandwith.weight;

import org.araymond.joal.core.bandwith.Peers;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;

import static org.assertj.core.api.Assertions.assertThat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.turn.ttorrent.common.protocol.TrackerMessage.AnnounceRequestMessage.RequestEvent;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.io.IOException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.araymond.joal.core.client.emulated.generator.peerid.PeerIdGeneratorTest;
import org.araymond.joal.core.client.emulated.utils.Casing;
import org.araymond.joal.core.torrent.torrent.InfoHash;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;

import java.util.AbstractMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.araymond.joal.core.SeedManager;
import org.araymond.joal.core.config.JoalConfigProvider;
import org.araymond.joal.core.config.JoalConfigProviderTest;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;

import java.io.FileNotFoundException;
Expand Down Expand Up @@ -47,21 +47,23 @@ public void shouldReturnSameClientEveryTimes() throws FileNotFoundException {
final BitTorrentClientProvider provider = createProvider();

assertThat(provider.get())
.isEqualToComparingFieldByField(provider.get())
.isEqualToComparingFieldByField(provider.get())
.isEqualToComparingFieldByField(provider.get())
.isEqualToComparingFieldByField(provider.get());
.usingRecursiveComparison()
.isEqualTo(provider.get())
.isEqualTo(provider.get())
.isEqualTo(provider.get())
.isEqualTo(provider.get());
}

@Test
public void shouldChangeClientEveryTimesGenerateIsCalled() throws FileNotFoundException {
final BitTorrentClientProvider provider = createProvider();

assertThat(provider.get())
.isEqualToComparingFieldByField(provider.get())
.isEqualToComparingFieldByField(provider.get())
.isEqualToComparingFieldByField(provider.get())
.isEqualToComparingFieldByField(provider.get());
.usingRecursiveComparison()
.isEqualTo(provider.get())
.isEqualTo(provider.get())
.isEqualTo(provider.get())
.isEqualTo(provider.get());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import org.araymond.joal.core.torrent.torrent.InfoHash;
import org.araymond.joal.core.ttorrent.client.ConnectionHandler;
import org.araymond.joal.core.ttorrent.client.ConnectionHandlerTest;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.util.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.araymond.joal.core.client.emulated.BitTorrentClientConfig.HttpHeader;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.io.IOException;

Expand Down Expand Up @@ -50,7 +50,7 @@ public void shouldDeserialize() throws IOException {
@Test
public void shouldSerializeAndDeserialize() throws IOException {
final HttpHeader header = new HttpHeader("Connection", "close");
assertThat(mapper.readValue(mapper.writeValueAsString(header), HttpHeader.class)).isEqualToComparingFieldByField(header);
assertThat(mapper.readValue(mapper.writeValueAsString(header), HttpHeader.class)).usingRecursiveComparison().isEqualTo(header);
}

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.araymond.joal.core.client.emulated;

import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.araymond.joal.core.client.emulated.BitTorrentClientConfig.HttpHeader;
import static org.assertj.core.api.Assertions.assertThat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.fasterxml.jackson.databind.ObjectMapper;
import org.araymond.joal.core.client.emulated.utils.Casing;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.io.IOException;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.araymond.joal.core.client.emulated.generator;

import org.araymond.joal.core.client.emulated.utils.Casing;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.araymond.joal.core.client.emulated.generator.key.algorithm.KeyAlgorithm;
import org.araymond.joal.core.client.emulated.utils.Casing;
import org.araymond.joal.core.torrent.torrent.InfoHash;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;

import java.nio.ByteBuffer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.araymond.joal.core.client.emulated.generator.key.algorithm.HashKeyAlgorithm;
import org.araymond.joal.core.client.emulated.generator.key.algorithm.KeyAlgorithm;
import org.araymond.joal.core.client.emulated.utils.Casing;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.io.IOException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.araymond.joal.core.client.emulated.generator.key.algorithm.KeyAlgorithm;
import org.araymond.joal.core.client.emulated.utils.Casing;
import org.araymond.joal.core.torrent.torrent.InfoHash;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.araymond.joal.core.client.emulated.generator.key.algorithm.KeyAlgorithm;
import org.araymond.joal.core.client.emulated.utils.Casing;
import org.araymond.joal.core.torrent.torrent.InfoHash;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;

import java.nio.ByteBuffer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.araymond.joal.core.client.emulated.generator.key.algorithm.KeyAlgorithm;
import org.araymond.joal.core.client.emulated.utils.Casing;
import org.araymond.joal.core.torrent.torrent.InfoHash;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;

import java.time.LocalDateTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.araymond.joal.core.client.emulated.generator.key.algorithm.KeyAlgorithm;
import org.araymond.joal.core.client.emulated.utils.Casing;
import org.araymond.joal.core.torrent.torrent.InfoHash;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;

import java.time.LocalDateTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.araymond.joal.core.client.emulated.utils.Casing;
import org.araymond.joal.core.torrent.torrent.InfoHash;
import org.araymond.joal.core.torrent.torrent.MockedTorrent;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;

import java.time.LocalDateTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.araymond.joal.core.client.emulated.utils.Casing;
import org.araymond.joal.core.torrent.torrent.InfoHash;
import org.araymond.joal.core.torrent.torrent.MockedTorrent;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;

import static org.assertj.core.api.Assertions.assertThat;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.araymond.joal.core.client.emulated.generator.key.algorithm;

import org.araymond.joal.core.client.emulated.TorrentClientConfigIntegrityException;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;

import static org.assertj.core.api.Assertions.assertThat;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.araymond.joal.core.client.emulated.generator.key.algorithm;

import org.araymond.joal.core.client.emulated.TorrentClientConfigIntegrityException;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.araymond.joal.core.client.emulated.generator.key.algorithm;

import org.araymond.joal.core.client.emulated.TorrentClientConfigIntegrityException;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentMatchers;
import org.mockito.Mockito;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.araymond.joal.core.client.emulated.generator.key.algorithm;

import org.araymond.joal.core.client.emulated.TorrentClientConfigIntegrityException;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.araymond.joal.core.client.emulated.generator.numwant;

import com.turn.ttorrent.common.protocol.TrackerMessage.AnnounceRequestMessage.RequestEvent;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.turn.ttorrent.common.protocol.TrackerMessage.AnnounceRequestMessage.RequestEvent;
import org.araymond.joal.core.client.emulated.generator.peerid.generation.PeerIdAlgorithm;
import org.araymond.joal.core.torrent.torrent.InfoHash;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;

import java.nio.ByteBuffer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.turn.ttorrent.common.protocol.TrackerMessage.AnnounceRequestMessage.RequestEvent;
import org.araymond.joal.core.client.emulated.generator.peerid.generation.PeerIdAlgorithm;
import org.araymond.joal.core.torrent.torrent.InfoHash;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;

import java.nio.ByteBuffer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.araymond.joal.core.client.emulated.generator.peerid;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.io.IOException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.araymond.joal.core.client.emulated.TorrentClientConfigIntegrityException;
import org.araymond.joal.core.client.emulated.generator.peerid.generation.RegexPatternPeerIdAlgorithm;
import org.araymond.joal.core.torrent.torrent.InfoHash;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.araymond.joal.core.client.emulated.TorrentClientConfigIntegrityException;
import org.araymond.joal.core.client.emulated.generator.peerid.generation.PeerIdAlgorithm;
import org.araymond.joal.core.torrent.torrent.InfoHash;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;

import java.time.LocalDateTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.araymond.joal.core.client.emulated.generator.peerid.generation.RegexPatternPeerIdAlgorithm;
import org.araymond.joal.core.torrent.torrent.InfoHash;
import org.araymond.joal.core.torrent.torrent.MockedTorrent;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;

import java.time.LocalDateTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.araymond.joal.core.client.emulated.generator.peerid.generation.PeerIdAlgorithm;
import org.araymond.joal.core.torrent.torrent.InfoHash;
import org.araymond.joal.core.torrent.torrent.MockedTorrent;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;

import static org.assertj.core.api.Assertions.assertThat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.araymond.joal.core.client.emulated.TorrentClientConfigIntegrityException;
import org.araymond.joal.core.client.emulated.generator.peerid.PeerIdGenerator;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;

import static org.assertj.core.api.Assertions.assertThat;
Expand Down
Loading

0 comments on commit c6b347b

Please sign in to comment.