Skip to content

Commit

Permalink
[tests] Add notes as to why tests are skipped due to usage of assumeT…
Browse files Browse the repository at this point in the history
…hat having to match to proceed with tests (#1170)
  • Loading branch information
hazendaz authored Mar 5, 2024
1 parent bb0da1b commit 4454cb2
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public static Iterable<Object[]> data() {
@ParameterizedTest(name = "\"{0}\" into \"{2}\"")
void getMimeType_ReturnsMimeType(String mimeType, String data, String name, String decodedData, String fileName) {
initEmbeddingWithNameTest(mimeType, data, name, decodedData, fileName);

// given
Embedding embedding = new Embedding(this.mimeType, this.data, this.name);

Expand All @@ -51,6 +52,7 @@ void getMimeType_ReturnsMimeType(String mimeType, String data, String name, Stri
@ParameterizedTest(name = "\"{0}\" into \"{2}\"")
void getData_ReturnsContent(String mimeType, String data, String name, String decodedData, String fileName) {
initEmbeddingWithNameTest(mimeType, data, name, decodedData, fileName);

// given
Embedding embedding = new Embedding(this.mimeType, this.data, this.name);

Expand All @@ -65,8 +67,10 @@ void getData_ReturnsContent(String mimeType, String data, String name, String de
@ParameterizedTest(name = "\"{0}\" into \"{2}\"")
void getDecodedData_ReturnsDecodedContent(String mimeType, String data, String name, String decodedData, String fileName) {
initEmbeddingWithNameTest(mimeType, data, name, decodedData, fileName);

// This assumeThat will cause 6 tests to be skipped from our 'data' usage
assumeThat(this.decodedData).isNotEqualTo(NO_DECODING);

// given
Embedding embedding = new Embedding(this.mimeType, this.data, this.name);

Expand All @@ -81,6 +85,8 @@ void getDecodedData_ReturnsDecodedContent(String mimeType, String data, String n
@ParameterizedTest(name = "\"{0}\" into \"{2}\"")
void getFileName_ReturnsFileName(String mimeType, String data, String name, String decodedData, String fileName) {
initEmbeddingWithNameTest(mimeType, data, name, decodedData, fileName);

// This assumeThat will cause 6 tests to be skipped from our 'data' usage
assumeThat(this.fileName).matches("^[^\\.]+\\.[^\\.]+$");

// given
Expand All @@ -97,6 +103,7 @@ void getFileName_ReturnsFileName(String mimeType, String data, String name, Stri
@ParameterizedTest(name = "\"{0}\" into \"{2}\"")
void getExtension_ReturnsFileExtension(String mimeType, String data, String name, String decodedData, String fileName) {
initEmbeddingWithNameTest(mimeType, data, name, decodedData, fileName);

// given
Embedding embedding = new Embedding(this.mimeType, this.data, this.name);

Expand All @@ -111,6 +118,7 @@ void getExtension_ReturnsFileExtension(String mimeType, String data, String name
@ParameterizedTest(name = "\"{0}\" into \"{2}\"")
void getName_ReturnsName(String mimeType, String data, String name, String decodedData, String fileName) {
initEmbeddingWithNameTest(mimeType, data, name, decodedData, fileName);

// given
Embedding embedding = new Embedding(this.mimeType, this.data, this.name);

Expand Down

0 comments on commit 4454cb2

Please sign in to comment.