Skip to content

Commit

Permalink
test(unittest): Make AdapterUtils unit test less stringy
Browse files Browse the repository at this point in the history
  • Loading branch information
djansen-redhat committed Feb 16, 2018
1 parent 956b811 commit 36c854e
Showing 1 changed file with 3 additions and 6 deletions.
Expand Up @@ -39,8 +39,7 @@ public void testNull() {
AdapterUtils.readStream(URI.create(""));
Assert.fail("Expected IllegalArgumentException");
} catch (IllegalArgumentException iae) {
assertThat(iae.getMessage()).contains("Could not open the URI. " +
"The URI must be absolute: URL is null");
assertThat(iae.getMessage()).contains("absolute");
}
}

Expand All @@ -51,8 +50,7 @@ public void testMalformed() {
.create("http://2aff:eaff:eaff:7aff:8aff:5aff:faff:eaff:8080/foo"));
Assert.fail("Expected FileFormatAdapterException");
} catch (FileFormatAdapterException ffae) {
assertThat(ffae.getMessage()).contains("Could not open the URI. " +
"The URI may be malformed: URL is null");
assertThat(ffae.getMessage()).contains("malformed");
}
}

Expand All @@ -62,8 +60,7 @@ public void testAccess() {
AdapterUtils.readStream(URI.create("http://tmp"));
Assert.fail("Expected FileFormatAdapterException");
} catch (FileFormatAdapterException ffae) {
assertThat(ffae.getMessage()).contains("Could not open the URL. " +
"The URL is OK but the input stream could not be opened.\ntmp");
assertThat(ffae.getMessage()).contains("stream");
}
}
}

0 comments on commit 36c854e

Please sign in to comment.