Skip to content

Commit

Permalink
convert to junit 5 / use assertj everywhere (#1092)
Browse files Browse the repository at this point in the history
* include common test dependencies by default

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to assertj

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to assertj

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to assertj

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to assertj

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to assertj

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to assertj

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to assertj

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to assertj

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to assertj

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to assertj

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to assertj

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to assertj

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to assertj

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to assertj

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to assertj

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to assertj

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to assertj

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to assertj

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to assertj

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to assertj

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to assertj

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to assertj

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to assertj

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to assertj

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to assertj

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to assertj

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to assertj

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to assertj

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to assertj

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to assertj

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to junit5

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to junit5

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to junit5

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to junit5

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to junit5

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to junit5

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to junit5

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to junit5

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to junit5

Signed-off-by: Gregor Zeitlinger <[email protected]>

* convert to junit5

Signed-off-by: Gregor Zeitlinger <[email protected]>

---------

Signed-off-by: Gregor Zeitlinger <[email protected]>
  • Loading branch information
zeitlinger authored Oct 7, 2024
1 parent 0327d2f commit 5e282c8
Show file tree
Hide file tree
Showing 118 changed files with 1,926 additions and 2,139 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import java.util.Random;
*/

public class ManualCompleteMetricsTest {
class ManualCompleteMetricsTest {

// This contains a complete set of all metric types, and target_info and otel_scope_info.
// I used this to expose in Prometheus format and OTLP format at the same time and compare the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package io.prometheus.client.it.common;

import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;

import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.*;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.function.Predicate;
import org.junit.Assert;

/** Temporary directory in ./target/ to be mounted as a volume in Docker containers. */
public class Volume {
Expand All @@ -21,8 +22,9 @@ private Volume(Path tmpDir) {

public static Volume create(String prefix) throws IOException, URISyntaxException {
Path targetDir = Paths.get(Volume.class.getResource("/").toURI()).getParent();
Assert.assertEquals(
"failed to locate target/ directory", "target", targetDir.getFileName().toString());
assertThat(targetDir.getFileName().toString())
.as("failed to locate target/ directory")
.isEqualTo("target");
return new Volume(Files.createTempDirectory(targetDir, prefix + "-"));
}

Expand Down Expand Up @@ -59,7 +61,7 @@ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs)
}
});
} else {
Assert.fail(src + ": No such file or directory");
fail(src + ": No such file or directory");
}
return this;
}
Expand Down
13 changes: 6 additions & 7 deletions integration-tests/it-exporter/it-exporter-test/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand All @@ -15,6 +16,10 @@
Integration Tests for Exporters
</description>

<properties>
<maven.javadoc.skip>true</maven.javadoc.skip>
</properties>

<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
Expand All @@ -37,12 +42,6 @@
<artifactId>prometheus-metrics-exposition-formats</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
Expand Down
Loading

0 comments on commit 5e282c8

Please sign in to comment.