Remove redundant throws declarations from internal APIs

Closes gh-31176
This commit is contained in:
Andy Wilkinson
2022-05-26 14:24:55 +01:00
parent cbf42dea14
commit ee45fd2fc8
69 changed files with 157 additions and 193 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -49,7 +49,7 @@ class BuildpackCoordinatesTests extends AbstractJsonTests {
}
@Test
void fromTomlWhenMissingDescriptorThrowsException() throws Exception {
void fromTomlWhenMissingDescriptorThrowsException() {
ByteArrayInputStream coordinates = new ByteArrayInputStream("".getBytes());
assertThatIllegalArgumentException().isThrownBy(() -> BuildpackCoordinates.fromToml(coordinates, this.archive))
.withMessageContaining("Buildpack descriptor 'buildpack.toml' is required")
@@ -57,7 +57,7 @@ class BuildpackCoordinatesTests extends AbstractJsonTests {
}
@Test
void fromTomlWhenMissingIDThrowsException() throws Exception {
void fromTomlWhenMissingIDThrowsException() {
InputStream coordinates = createTomlStream(null, null, true, false);
assertThatIllegalArgumentException().isThrownBy(() -> BuildpackCoordinates.fromToml(coordinates, this.archive))
.withMessageContaining("Buildpack descriptor must contain ID")
@@ -65,7 +65,7 @@ class BuildpackCoordinatesTests extends AbstractJsonTests {
}
@Test
void fromTomlWhenMissingVersionThrowsException() throws Exception {
void fromTomlWhenMissingVersionThrowsException() {
InputStream coordinates = createTomlStream("example/buildpack1", null, true, false);
assertThatIllegalArgumentException().isThrownBy(() -> BuildpackCoordinates.fromToml(coordinates, this.archive))
.withMessageContaining("Buildpack descriptor must contain version")
@@ -73,7 +73,7 @@ class BuildpackCoordinatesTests extends AbstractJsonTests {
}
@Test
void fromTomlWhenMissingStacksAndOrderThrowsException() throws Exception {
void fromTomlWhenMissingStacksAndOrderThrowsException() {
InputStream coordinates = createTomlStream("example/buildpack1", "0.0.1", false, false);
assertThatIllegalArgumentException().isThrownBy(() -> BuildpackCoordinates.fromToml(coordinates, this.archive))
.withMessageContaining("Buildpack descriptor must contain either 'stacks' or 'order'")
@@ -81,7 +81,7 @@ class BuildpackCoordinatesTests extends AbstractJsonTests {
}
@Test
void fromTomlWhenContainsBothStacksAndOrderThrowsException() throws Exception {
void fromTomlWhenContainsBothStacksAndOrderThrowsException() {
InputStream coordinates = createTomlStream("example/buildpack1", "0.0.1", true, true);
assertThatIllegalArgumentException().isThrownBy(() -> BuildpackCoordinates.fromToml(coordinates, this.archive))
.withMessageContaining("Buildpack descriptor must not contain both 'stacks' and 'order'")

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -58,7 +58,7 @@ class FilePermissionsTests {
@Test
@DisabledOnOs(OS.WINDOWS)
void umaskForPathWithNonExistentFile() throws IOException {
void umaskForPathWithNonExistentFile() {
assertThatIOException()
.isThrownBy(() -> FilePermissions.umaskForPath(Paths.get(this.tempDir.toString(), "does-not-exist")));
}
@@ -72,7 +72,7 @@ class FilePermissionsTests {
}
@Test
void umaskForPathWithNullPath() throws IOException {
void umaskForPathWithNullPath() {
assertThatIllegalArgumentException().isThrownBy(() -> FilePermissions.umaskForPath(null));
}