fix(emr-serverless): answer UpdateApplication with the updated application (#8369)

UpdateApplication answered {applicationId, arn, name}, while the model's
UpdateApplicationResponse is {application}, required: "Information about
the updated application". A client reading it found no application: a
KeyError in boto3, a null in the Java SDK. It now answers with the
application as GetApplication reports it, without the clientToken
storage keeps for CreateApplication's retries.
This commit is contained in:
Priamo Germosen authored and GitHub committed 2026-11-14 17:22:54 -04:00
1 parent 0a8b6396ac
commit d5e831bd54
4 files changed
+24 -15

No files matched your search

+2
View File
@@ -58,6 +58,8 @@ another.
`interactiveConfiguration`, `identityCenterConfiguration` and `jobLevelCostAllocationConfiguration`
among them, and `GetApplication` returns each as it was written.
`UpdateApplication` answers with the updated application, as `GetApplication` reports it.
`UpdateApplication` changes any setting of a `CREATED` or `STOPPED` application, and of a `STARTED` one its
`maximumCapacity` and its custom images, `imageConfiguration` and `workerTypeSpecifications`, as the user guide's
"Updating Running Applications" describes. For every other setting the API reference's "An application has to be in
@@ -95,11 +95,8 @@ public class EmrServerlessController {
@Path("/{applicationId}")
public UpdateApplicationResponse updateApplication(@PathParam("applicationId") String applicationId,
UpdateApplicationRequest request) {
Application app = service.updateApplication(applicationId, request);
UpdateApplicationResponse response = new UpdateApplicationResponse();
response.setApplicationId(app.getApplicationId());
response.setArn(app.getArn());
response.setName(app.getName());
response.setApplication(service.updateApplication(applicationId, request));
return response;
}
@@ -1,17 +1,21 @@
package io.floci.aws.services.emrserverless.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.quarkus.runtime.annotations.RegisterForReflection;
/** UpdateApplication's answer: "Information about the updated application", as GetApplication reports it. */
@RegisterForReflection
public class UpdateApplicationResponse {
private String applicationId;
private String arn;
private String name;
public String getApplicationId() { return applicationId; }
public void setApplicationId(String applicationId) { this.applicationId = applicationId; }
public String getArn() { return arn; }
public void setArn(String arn) { this.arn = arn; }
public String getName() { return name; }
public void setName(String name) { this.name = name; }
// Without the clientToken storage keeps, as GetApplicationResponse leaves it out.
@JsonIgnoreProperties("clientToken")
private Application application;
public Application getApplication() {
return application;
}
public void setApplication(Application application) {
this.application = application;
}
}
@@ -251,8 +251,14 @@ public class EmrServerlessIntegrationTest {
.patch("/applications/" + applicationId)
.then()
.statusCode(200)
.body("applicationId", equalTo(applicationId));
// UpdateApplicationResponse: "Information about the updated application", as GetApplication's.
.body("applicationId", nullValue())
.body("application.applicationId", equalTo(applicationId))
.body("application.state", equalTo("STOPPED"))
.body("application.releaseLabel", equalTo("emr-6.7.0"))
.body("application.runtimeConfiguration[0].properties.'spark.executor.memory'", equalTo("4g"))
.body("application", not(hasKey("clientToken")));
// Verify releaseLabel and new configurations updated
givenReq()
.when()