Skip to content

Commit

Permalink
Migrate tests to JUnit5 (#543)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tristan-WorkGH authored Oct 23, 2024
1 parent 6f7a9da commit f803ede
Show file tree
Hide file tree
Showing 106 changed files with 1,132 additions and 1,708 deletions.
57 changes: 15 additions & 42 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@
<properties>
<gridsuite-dependencies.version>34</gridsuite-dependencies.version>
<db-util.version>1.0.5</db-util.version>
<log4j2-mock-version>0.0.2</log4j2-mock-version>
<testcontainers.version>1.16.2</testcontainers.version>
<mockwebserver3.version>5.0.0-alpha.14</mockwebserver3.version>
<liquibase-hibernate-package>org.gridsuite.modification.server</liquibase-hibernate-package>
<!-- FIXME: powsybl-network-store modules'version is overloaded in the dependencies section.The overloads and this property below have to be removed at next powsybl-ws-dependencies.version upgrade -->
<powsybl-network-store.version>1.19.0</powsybl-network-store.version>
Expand Down Expand Up @@ -87,6 +86,13 @@
<dependencyManagement>
<dependencies>
<!-- overrides of imports -->
<dependency><!-- To remove when integrate in next release of gridsuite-dependencies or powsybl-ws-dependencies -->
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp-bom</artifactId>
<version>${mockwebserver3.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.powsybl</groupId>
<artifactId>powsybl-network-store-client</artifactId>
Expand Down Expand Up @@ -117,23 +123,15 @@

<!-- project specific dependencies -->
<dependency>
<groupId>de.dentrassi.elasticsearch</groupId>
<artifactId>log4j2-mock</artifactId>
<version>${log4j2-mock-version}</version>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>elasticsearch</artifactId>
<version>${testcontainers.version}</version>
<scope>test</scope>
<groupId>com.vladmihalcea</groupId>
<artifactId>db-util</artifactId>
<version>${db-util.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>

<!-- Compilation dependencies -->

<dependency>
<groupId>org.gridsuite</groupId>
<artifactId>gridsuite-filter</artifactId>
Expand Down Expand Up @@ -219,71 +217,46 @@
</dependency>

<!-- Test dependencies -->

<dependency>
<groupId>com.powsybl</groupId>
<artifactId>powsybl-config-test</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-guava</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.vladmihalcea</groupId>
<artifactId>db-util</artifactId>
<version>${db-util.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>elasticsearch</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>de.dentrassi.elasticsearch</groupId>
<artifactId>log4j2-mock</artifactId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<groupId>org.testcontainers</groupId>
<artifactId>elasticsearch</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>mockwebserver</artifactId>
<artifactId>mockwebserver3-junit5</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-test-binder</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

package org.gridsuite.modification.server.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.SuperBuilder;

/**
Expand All @@ -21,8 +19,7 @@
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
@Data
@Schema(description = "Generator reactive capability curve point creation")
public class ReactiveCapabilityCurveModificationInfos {
@Schema(description = "Minimum reactive power ")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
import java.time.ZonedDateTime;
import java.util.Objects;

public final class HvdcTestNetwork {
final class HvdcTestNetwork {

private static final String DISCONNECTOR_NAME = "Disconnector";
private static final String BREAKER_NAME = "Breaker";

private HvdcTestNetwork() {
throw new IllegalStateException("Utility class");
}

private static Network createBase(NetworkFactory networkFactory) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

package org.gridsuite.modification.server;

import org.springframework.cloud.stream.binder.test.TestChannelBinderConfiguration;
Expand Down
Loading

0 comments on commit f803ede

Please sign in to comment.