test(lambda): remove redundant throws from ZIP fixture helpers (#8506)

Thirteen test helpers that only return LambdaCodeFixtures.nodeJsZip or
nodeJsZipBase64 with their own handler source drop the throws Exception
they kept after moving onto the shared fixture, which declares no
checked exception.
This commit is contained in:
Andre Kurait authored and GitHub committed 2026-11-15 16:24:21 -04:00
1 parent d5f6ae23a4
commit e257640516
13 files changed
+13 -13

No files matched your search

@@ -33,7 +33,7 @@ public final class WebSocketTestSupport {
* Creates a Base64-encoded ZIP file containing a single index.js with the given handler code.
* Used to create Lambda function deployment packages in tests.
*/
public static String createLambdaZip(String handlerCode) throws Exception {
public static String createLambdaZip(String handlerCode) {
return LambdaCodeFixtures.nodeJsZipBase64(handlerCode);
}
@@ -130,7 +130,7 @@ class LambdaExecutionRoleIamEnforcementIntegrationTest {
}
}
private static String handlerZipBase64() throws Exception {
private static String handlerZipBase64() {
return LambdaCodeFixtures.nodeJsZipBase64("exports.handler = async () => ({});\n");
}
@@ -146,7 +146,7 @@ class KinesisEsmOnFailureDockerIntegrationTest {
+ " s, checkpoints: " + checkpoints);
}
private static String poisonRaisingZipBase64() throws Exception {
private static String poisonRaisingZipBase64() {
return LambdaCodeFixtures.nodeJsZipBase64("""
exports.handler = async (event) => {
for (const record of event.Records) {
@@ -163,7 +163,7 @@ class LambdaAsyncRetryDockerIntegrationTest {
given().when().delete(BASE_PATH + "/functions/" + functionName);
}
private static String failingZipBase64() throws Exception {
private static String failingZipBase64() {
return LambdaCodeFixtures.nodeJsZipBase64("exports.handler = async () => { throw new Error('boom'); };\n");
}
@@ -69,7 +69,7 @@ class LambdaFunctionUrlAccountRoutingTest {
.extract().path("FunctionUrl");
}
private byte[] lambdaZip() throws Exception {
private byte[] lambdaZip() {
return LambdaCodeFixtures.nodeJsZip("""
exports.handler = async (event) => ({
statusCode: 200,
@@ -55,7 +55,7 @@ class LambdaFunctionUrlResponseStreamTest {
return functionUrl.substring(scheme + 3, functionUrl.indexOf('.', scheme + 3));
}
private byte[] lambdaZip() throws Exception {
private byte[] lambdaZip() {
return LambdaCodeFixtures.nodeJsZip("""
exports.handler = awslambda.streamifyResponse(async (event, responseStream) => {
responseStream = awslambda.HttpResponseStream.from(responseStream, {
@@ -217,7 +217,7 @@ class LambdaLayerCodePathIsolationTest {
return Base64.getEncoder().encodeToString(zipBytes(content));
}
private static byte[] zipBytes(String content) throws Exception {
private static byte[] zipBytes(String content) {
return LambdaCodeFixtures.nodeJsZip(content);
}
@@ -42,7 +42,7 @@ class LambdaLayerIntegrationTest {
return Base64.getEncoder().encodeToString(baos.toByteArray());
}
private static String functionZipBase64() throws Exception {
private static String functionZipBase64() {
return LambdaCodeFixtures.nodeJsZipBase64("exports.handler = async () => ({ statusCode: 200 });");
}
@@ -26,7 +26,7 @@ class LambdaReactiveSyncIntegrationTest {
private static final String KEY = "function.zip";
private static final String FN = "reactive-sync-fn";
private static byte[] makeZip(String body) throws Exception {
private static byte[] makeZip(String body) {
return LambdaCodeFixtures.nodeJsZip("exports.handler = async (e) => ({ body: '" + body + "' });");
}
@@ -50,7 +50,7 @@ class LambdaS3DeploymentIntegrationTest {
}
}
private static byte[] makeZip(String body) throws Exception {
private static byte[] makeZip(String body) {
return LambdaCodeFixtures.nodeJsZip("exports.handler = async () => ({ body: '" + body + "' });");
}
}
@@ -2864,7 +2864,7 @@ class LambdaServiceTest {
.map(LambdaFunction::getVersion).collect(Collectors.toSet()));
}
private static String zipWithBody(String body) throws Exception {
private static String zipWithBody(String body) {
return LambdaCodeFixtures.nodeJsZipBase64(body + "\n");
}
@@ -173,7 +173,7 @@ class PipesStreamEnrichmentDockerIntegrationTest {
.statusCode(201);
}
private static String enrichmentZipBase64() throws Exception {
private static String enrichmentZipBase64() {
return LambdaCodeFixtures.nodeJsZipBase64("""
exports.handler = async (records) => records.flatMap((record) => {
const rowId = record.dynamodb.Keys.sk.S.split('#')[1];
@@ -85,7 +85,7 @@ class S3InternalLambdaCodeDownloadIntegrationTest {
}
}
private static byte[] archive(String marker) throws Exception {
private static byte[] archive(String marker) {
return LambdaCodeFixtures.nodeJsZip("exports.handler = async () => '" + marker + "';");
}
}