(The exact change is slightly different in some cases, like when using custom subjects or check(), but it's always a migration from named(...) to [assert]WithMessage(...).)
named(...) is being removed.
This CL may slightly modify the failure messages produced, but all the old information will still be present.
More information:
[]
Tested:
TAP --sample for global presubmit queue
[]
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=245762634
For example:
assertThat(actual().foo()).isEqualTo(expected);
becomes:
check("foo()").that(actual().foo()).isEqualTo(expected);
More information:
[]
Tested:
TAP --sample for global presubmit queue
[]
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=245750144
Migrate Truth subjects from the old fail(String, Object) to the new failWithActual(String, Object), tweaking verbs for the new grammar.
Before:
fail("has foo", expected);
After:
failWithActual("expected to have foo", expected);
Open-source note: The fail*() methods used by this CL were added in Truth 0.41.
More information:
[]
Tested:
TAP --sample for global presubmit queue
[]
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=244418884
See []
Requires the use of Guava 25.1 for Strings.lenientFormat and Truth 0.41 for Subject.failWithoutActual
RELNOTES: Migrated from Subject.failWithRawMessage to Subject.failWithoutActual
BEGIN_PUBLIC
Migrated from Subject.failWithRawMessage to Subject.failWithoutActual
END_PUBLIC
Tested:
TAP --sample for global presubmit queue
[]
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205709366
The intention (from []is:
- actualAsString() is the method that people call.
- actualCustomStringRepresentation() is the method that people override.
Fortunately, no one actually calls actualCustomStringRepresentation(), aside from some tests that call it to test a subject's implementation. That's easy enough to work around by extracting a method.
(Arguably @ForOverride should permit calls from tests in some cases (now that Error Prone knows how to identify test code). But it's not entirely clear, since, e.g., people shouldn't be testing Converter.doForward(null) because the method can never be invoked that way. Some discussion here: []Tested:
global TAP
[]
RELNOTES=Marked `actualCustomStringRepresentation()` as `@ForOverride`. To retrieve the string representation, call `actualAsString()`.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185672328
Also changed truth.SubjectFactory to truth.Subject.Factory (plain renaming) and use method reference instead of anonymous class to create the factory when applicable.
FailureMetadata, an opaque object to its users, is introduced to replace FailureStrategy in in custom Subject in order to resolve some existing flaws of FailureStrategy as well as enable new features to be added to Truth.
New API is available in Truth-0.36, if there is a build/pom.xml, it's also updated to use this version.
More information: See []
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176110788
This was a surprisingly involved change. Some of the difficulties included
java.util.Optional purposely not being Serializable (so I had to move a
few Optionals in mapreduce classes to @Nullable) and having to add the Truth
Java8 extension library for assertion support.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171863777
Currently, the message you get when using e.g. assertAboutContacts().that(alice).isEqualTo(bob) is not very helpful, because we override the "actual" toString (for alice) to return just an abbreviated version, and dump the entire full ImmutableObject toString for bob:
java.lang.AssertionError: Not true that <ContactResource with foreign key 'contact_id'> is equal to ContactResource (@2125903542): {
authInfo=ContactAuthInfo (@2128169374): ...
// giant blob of contact info here
}
So you can't even figure out why they aren't equal. Rather than reverting the "actual" object's toString representation in this case, which would just require you to visually compare two giant blobs of properties, this special-cases to let you compare using the prettyPrintEntityDeepDiff() helper we use in MutatingCommand.
With the new version, you see exactly what differs:
java.lang.AssertionError: Not true that <ContactResource with foreign key 'contact_id'> is equal to ContactResource (@2125903542): {
authInfo=ContactAuthInfo (@2128169374): ...
// giant blob of contact info here
}
It differs as follows:
transferData.pendingTransferExpirationTime -> [2017-03-27T16:01:39.882Z, 2020-05-08T16:01:39.882Z]
lastTransferTime -> [2017-03-27T16:01:39.882Z, 2020-05-08T16:01:39.882Z]
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151004823
In fact, completely eviscerate cloneProjectedAtTime (to be removed in
a followup CL) in favor of doing the projection of transfers and the
loading of values from the superordinate domain at call sites. This
is one of the issues that blocked the memcache audit work, since the
load inside of cloneProjectedAtTime could not be controlled by the
caller.
Note: fixed a minor bug where a subordinate host created after its superordinate domain was last transferred should have lastTransferTime==null but was previously reporting the domain's lastTransferTime.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=149769125
and HostResource.
DomainApplication is not transferable and has no need for this
field. HostResource needs it because it can be transferred with
a domain.
This is all in service of removing the ofy().load() inside of
host's cloneProjectedAtTime.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139346925
HostResource and DomainApplication are not transferable, (or at
least, not directly in the case of hosts) and have no need for
the TransferData field. In a flat-flow world, we can push it down
to where it's actually used.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139201423
This allows handling of N asynchronous deletion requests simultaneously instead
of just 1. An accumulation pull queue is used for deletion requests, and the
async deletion [] is now fired off whenever that pull queue isn't empty,
and processes many tasks at once. This doesn't particularly take more time,
because the bulk of the cost of the async delete operation is simply iterating
over all DomainBases (which has to happen regardless of how many contacts and
hosts are being deleted).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133169336
Daggerizes all of the EPP flows. This does not change anything yet
about the flows themselves, just how they are invoked, but after
this CL it's safe to @Inject things into flow classes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125382478
The dark lord Gosling designed the Java package naming system so that
ownership flows from the DNS system. Since we own the domain name
registry.google, it seems only appropriate that we should use
google.registry as our package name.
This change renames directories in preparation for the great package
rename. The repository is now in a broken state because the code
itself hasn't been updated. However this should ensure that git
correctly preserves history for each file.
2016-05-13 18:55:08 -04:00
Renamed from javatests/com/google/domain/registry/testing/AbstractEppResourceSubject.java (Browse further)