Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions DriveBackup/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.2</version>
</plugin>
</plugins>
</build>
<distributionManagement>
Expand Down Expand Up @@ -236,5 +241,17 @@
<artifactId>minio</artifactId>
<version>8.5.9</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.10.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>4.11.0</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
25 changes: 25 additions & 0 deletions DriveBackup/src/test/java/ratismal/drivebackup/ExampleTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package ratismal.drivebackup;

import org.junit.jupiter.api.Test;

import java.util.List;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

class ExampleTest {

@Test
void exampleWithMockito() {
@SuppressWarnings("unchecked")
List<String> mockedList = mock();

when(mockedList.get(0)).thenReturn("first");

assertEquals("first", mockedList.get(0));

assertNull(mockedList.get(999));
}
}
4 changes: 4 additions & 0 deletions DriveBackup/src/test/resources/junit-platform.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
junit.jupiter.testmethod.order.default = org.junit.jupiter.api.MethodOrderer$Random
junit.jupiter.testclass.order.default = org.junit.jupiter.api.ClassOrderer$Random
junit.jupiter.execution.parallel.enabled = true
junit.jupiter.execution.parallel.mode.default = concurrent