-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored integration tests (#1025)
* Refactored integration tests Signed-off-by: dhoard <[email protected]>
- Loading branch information
Showing
71 changed files
with
5,113 additions
and
2,006 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,5 @@ output.log | |
stress-test.log | ||
test.sh | ||
test.log | ||
verify-full.sh | ||
verify-full.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
...test_suite/integration_tests/src/main/java/io/prometheus/jmx/test/support/Assertions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package io.prometheus.jmx.test.support; | ||
|
||
import static java.lang.String.format; | ||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import io.prometheus.jmx.test.support.http.HttpResponse; | ||
import io.prometheus.jmx.test.support.http.HttpResponseBody; | ||
|
||
/** Class to implement Assertions */ | ||
public class Assertions { | ||
|
||
/** Constructor */ | ||
private Assertions() { | ||
// INTENTIONALLY BLANK | ||
} | ||
|
||
/** | ||
* Assert a health response | ||
* | ||
* @param httpResponse httpResponse | ||
*/ | ||
public static void assertHealthyResponse(HttpResponse httpResponse) { | ||
assertThat(httpResponse).isNotNull(); | ||
assertThat(httpResponse.statusCode()).isEqualTo(200); | ||
assertThat(httpResponse.body()).isNotNull(); | ||
assertThat(httpResponse.body().string()).isNotBlank(); | ||
assertThat(httpResponse.body().string()).contains("Exporter is healthy."); | ||
} | ||
|
||
/** | ||
* Assert common metrics response | ||
* | ||
* @param httpResponse httpResponse | ||
*/ | ||
public static void assertCommonMetricsResponse(HttpResponse httpResponse) { | ||
assertThat(httpResponse).isNotNull(); | ||
|
||
int statusCode = httpResponse.statusCode(); | ||
if (statusCode != 200) { | ||
HttpResponseBody body = httpResponse.body(); | ||
if (body != null) { | ||
throw new AssertionError( | ||
format( | ||
"Expected statusCode [%d] but was [%d] body [%s]", | ||
200, statusCode, body.string())); | ||
} else { | ||
throw new AssertionError( | ||
format("Expected statusCode [%d] but was [%d] no body", 200, statusCode)); | ||
} | ||
} | ||
|
||
assertThat(httpResponse.headers()).isNotNull(); | ||
assertThat(httpResponse.headers().get("CONTENT-TYPE")).hasSize(1); | ||
assertThat(httpResponse.body()).isNotNull(); | ||
assertThat(httpResponse.body().bytes()).isNotNull(); | ||
assertThat(httpResponse.body().bytes().length).isGreaterThan(0); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 0 additions & 49 deletions
49
...src/main/java/io/prometheus/jmx/test/support/http/HttpBasicAuthenticationCredentials.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.