Skip to content

Commit 0a449a5

Browse files
cpovirkronshapiro
authored andcommitted
Update to Truth 0.45, and address deprecations.
Renames may include: - containsAllOf => containsAtLeast - containsAllIn => containsAtLeastElementsIn - isSameAs => isSameInstanceAs - isOrdered => isInOrder - isStrictlyOrdered => isInStrictOrder The other major change is to change custom subjects to extend raw Subject instead of supplying type parameters. The type parameters are being removed from Subject. This CL will temporarily produce rawtypes warnings, which will go away when I remove the type parameters (as soon as this batch of CLs is submitted). Some CLs in this batch also migrate calls away from actualAsString(). Its literal replacement is `"<" + actual + ">"` (unless an object overrides actualCustomStringRepresentation()), but usually I've made a larger change, such as switching from an old-style "Not true that..." failure message to one generated with the Fact API. In that case, the new code usually contains a direct reference to this.actual (a field that I occasionally had to create). Another larger change I sometimes made is to switch from a manual check-and-fail approach to instead use check(...). And sometimes I just remove a withMessage() call that's no longer necessary now that the code uses check(...), or I introduce a check(...) call. (An assertion made with check(...) automatically includes the actual value from the original subject, so there's no need to set it again with withMessage().) Finally, there's one CL in this batch in which I migrate a Correspondence subclass to instead use Correspondence.from. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=251472235
1 parent 64242e1 commit 0a449a5

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

core/src/test/java/com/google/googlejavaformat/java/PartialFormattingTest.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,10 @@ public void blankAndComment() throws Exception {
592592
" // No maxResults",
593593
" assertThat(achievementFirstPartyHelper.listDefinitionsByApplication(",
594594
" STUB_GAIA_ID, STUB_APPLICATION_ID, Optional.<Integer>absent(),",
595-
" Optional.<String>absent()).getAchievements()).containsExactly(createExpectedDefinition(1), createIncrementalExpectedDefinition(2), createExpectedDefinition(3), createIncrementalExpectedDefinition(4)).inOrder();",
595+
" "
596+
+ " Optional.<String>absent()).getAchievements()).containsExactly(createExpectedDefinition(1),"
597+
+ " createIncrementalExpectedDefinition(2), createExpectedDefinition(3),"
598+
+ " createIncrementalExpectedDefinition(4)).inOrder();",
596599
" }",
597600
"}",
598601
"",
@@ -892,7 +895,7 @@ public void testReplacementsSorted() throws Exception {
892895
startPositions.add(replacement.getReplaceRange().lowerEndpoint());
893896
}
894897
assertThat(startPositions).hasSize(3);
895-
assertThat(startPositions).isStrictlyOrdered();
898+
assertThat(startPositions).isInStrictOrder();
896899
}
897900

898901
@Test
@@ -920,7 +923,7 @@ public void testReplacementsSorted_DescendingInput() throws Exception {
920923
startPositions.add(replacement.getReplaceRange().lowerEndpoint());
921924
}
922925
assertThat(startPositions).hasSize(3);
923-
assertThat(startPositions).isStrictlyOrdered();
926+
assertThat(startPositions).isInStrictOrder();
924927
}
925928

926929
private void testFormatLine(String input, String expectedOutput, int i) throws Exception {

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
<java.version>1.8</java.version>
9898
<guava.version>27.0.1-jre</guava.version>
9999
<javac.version>9+181-r4173-1</javac.version>
100-
<truth.version>0.44</truth.version>
100+
<truth.version>0.45</truth.version>
101101
<jsr305.version>3.0.2</jsr305.version>
102102
</properties>
103103

0 commit comments

Comments
 (0)