mirror of
https://github.com/google/nomulus
synced 2026-09-12 11:06:29 +00:00
Fix nomulus GetEppResourceCommand (#1865)
* Fix nomulus GetEppResourceCommand Fixes a bug in read_timestamp validation. Fixes string representation of Collection fields in Epp Resources.
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
|
||||
package google.registry.model;
|
||||
|
||||
import static com.google.common.collect.Iterables.transform;
|
||||
import static com.google.common.collect.Maps.transformValues;
|
||||
import static java.lang.annotation.ElementType.FIELD;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
@@ -178,7 +179,7 @@ public abstract class ImmutableObject implements Cloneable {
|
||||
return transformValues((Map<?, ?>) value, ImmutableObject::hydrate);
|
||||
}
|
||||
if (value instanceof Collection) {
|
||||
return ((Collection<?>) value).stream().map(ImmutableObject::hydrate);
|
||||
return transform((Collection<?>) value, ImmutableObject::hydrate);
|
||||
}
|
||||
if (value instanceof ImmutableObject) {
|
||||
return ((ImmutableObject) value).toHydratedString();
|
||||
|
||||
@@ -60,11 +60,11 @@ abstract class GetEppResourceCommand implements CommandWithRemoteApi {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
DateTime now = clock.nowUtc();
|
||||
if (readTimestamp == null) {
|
||||
readTimestamp = clock.nowUtc();
|
||||
readTimestamp = now;
|
||||
}
|
||||
checkArgument(
|
||||
!readTimestamp.isBefore(clock.nowUtc()), "--read_timestamp may not be in the past");
|
||||
checkArgument(!readTimestamp.isBefore(now), "--read_timestamp may not be in the past");
|
||||
runAndPrint();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user