-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Make Model Upload await logs rather than delay 1.5s - Fix inconsistency in SchedulingTests.beforeEach
- Loading branch information
1 parent
ae383db
commit 1abfe04
Showing
5 changed files
with
199 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
e2e-tests/src/test/java/gov/nasa/jpl/aerie/e2e/types/ModelEventLogs.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package gov.nasa.jpl.aerie.e2e.types; | ||
|
||
import javax.json.JsonObject; | ||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
public record ModelEventLogs( | ||
int modelId, | ||
String modelName, | ||
String modelVersion, | ||
List<EventLog> refreshActivityTypesLogs, | ||
List<EventLog> refreshModelParamsLogs, | ||
List<EventLog> refreshResourceTypesLogs | ||
) { | ||
public record EventLog( | ||
String triggeringUser, | ||
boolean delivered, | ||
boolean success, | ||
int tries, | ||
String createdAt, | ||
int status, | ||
Optional<JsonObject> error, | ||
Optional<String> errorMessage, | ||
Optional<String> errorType | ||
) | ||
{ | ||
public static EventLog fromJSON(JsonObject json) { | ||
final Optional<JsonObject> error = json.isNull("error") ? | ||
Optional.empty() : Optional.of(json.getJsonObject("error")); | ||
final Optional<String> errorMsg = json.isNull("error_message") ? | ||
Optional.empty() : Optional.of(json.getString("error_message")); | ||
final Optional<String> errorType = json.isNull("error") ? | ||
Optional.empty() : Optional.of(json.getString("error")); | ||
|
||
return new EventLog( | ||
json.getString("triggering_user"), | ||
json.getBoolean("delivered"), | ||
json.getBoolean("success"), | ||
json.getInt("tries"), | ||
json.getString("created_at"), | ||
json.getInt("status"), | ||
error, | ||
errorMsg, | ||
errorType); | ||
} | ||
} | ||
|
||
public static ModelEventLogs fromJSON(JsonObject json) { | ||
return new ModelEventLogs( | ||
json.getInt("id"), | ||
json.getString("name"), | ||
json.getString("version"), | ||
json.getJsonArray("refresh_activity_type_logs").getValuesAs(EventLog::fromJSON), | ||
json.getJsonArray("refresh_model_parameter_logs").getValuesAs(EventLog::fromJSON), | ||
json.getJsonArray("refresh_resource_type_logs").getValuesAs(EventLog::fromJSON) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters