mirror of
https://github.com/google/nomulus.git
synced 2025-05-15 00:47:11 +02:00
Migrate from assertThat(foo).named("foo") to assertWithMessage("foo").that(foo).
(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
This commit is contained in:
parent
de5f3e6177
commit
124d7375c3
11 changed files with 40 additions and 34 deletions
|
@ -18,6 +18,7 @@ import static com.google.common.base.CaseFormat.LOWER_UNDERSCORE;
|
|||
import static com.google.common.base.CaseFormat.UPPER_CAMEL;
|
||||
import static com.google.common.reflect.Reflection.getPackageName;
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static com.google.common.truth.Truth.assertWithMessage;
|
||||
|
||||
import com.beust.jcommander.Parameters;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
@ -59,14 +60,12 @@ public class RegistryToolTest {
|
|||
ImmutableSet<?> commandMapClasses = ImmutableSet.copyOf(RegistryTool.COMMAND_MAP.values());
|
||||
ImmutableSet<?> classLoaderClasses = getAllCommandClasses();
|
||||
// Not using plain old containsExactlyElementsIn() since it produces a huge unreadable blob.
|
||||
assertThat(
|
||||
Sets.difference(commandMapClasses, classLoaderClasses))
|
||||
.named("command classes in RegistryTool.COMMAND_MAP but not found by class loader")
|
||||
.isEmpty();
|
||||
assertThat(
|
||||
Sets.difference(classLoaderClasses, commandMapClasses))
|
||||
.named("command classes found by class loader but not in RegistryTool.COMMAND_MAP")
|
||||
.isEmpty();
|
||||
assertWithMessage("command classes in RegistryTool.COMMAND_MAP but not found by class loader")
|
||||
.that(Sets.difference(commandMapClasses, classLoaderClasses))
|
||||
.isEmpty();
|
||||
assertWithMessage("command classes found by class loader but not in RegistryTool.COMMAND_MAP")
|
||||
.that(Sets.difference(classLoaderClasses, commandMapClasses))
|
||||
.isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue