Skip to content

Commit

Permalink
mock: generation is an Integer field
Browse files Browse the repository at this point in the history
  • Loading branch information
petitlapin authored and manusa committed Mar 8, 2022
1 parent c7c0eb7 commit 610d8b7
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public MockResponse handleCreate(String path, String s) {

/**
* Replace the object on `path` endpoint with the object represented by `s`
*
*
* @param path String
* @param s String
* @return The {@link MockResponse}
Expand Down Expand Up @@ -470,7 +470,7 @@ private void setDefaultMetadata(JsonNode source, Map<String, String> pathValues,
metadata.put("namespace", pathValues.get(KubernetesAttributesExtractor.NAMESPACE));
}
metadata.put("uid", getOrDefault(existingMetadata, "uid", uuid.toString()));
metadata.put(GENERATION, getOrDefault(existingMetadata, GENERATION, "1"));
metadata.put(GENERATION, Integer.parseInt(getOrDefault(existingMetadata, GENERATION, "1")));
metadata.put("creationTimestamp", getOrDefault(existingMetadata, "creationTimestamp",
ZonedDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ISO_INSTANT)));

Expand Down

0 comments on commit 610d8b7

Please sign in to comment.