2121
2222import com .google .common .collect .ImmutableMap ;
2323import com .google .common .collect .ImmutableSet ;
24- import com .google .common .truth .Truth8 ;
2524import org .junit .Test ;
2625import org .junit .runner .RunWith ;
2726import org .junit .runners .JUnit4 ;
@@ -38,10 +37,10 @@ public void parseAndGetStringValue() {
3837 .parseFlag ("-XepOpt:Other:Arg:More:Parts=Long" )
3938 .parseFlag ("-XepOpt:EmptyArg=" )
4039 .build ();
41- Truth8 . assertThat (flags .get ("SomeArg" )).hasValue ("SomeValue" );
42- Truth8 . assertThat (flags .get ("Other:Arg:More:Parts" )).hasValue ("Long" );
43- Truth8 . assertThat (flags .get ("EmptyArg" )).hasValue ("" );
44- Truth8 . assertThat (flags .get ("absent" )).isEmpty ();
40+ assertThat (flags .get ("SomeArg" )).hasValue ("SomeValue" );
41+ assertThat (flags .get ("Other:Arg:More:Parts" )).hasValue ("Long" );
42+ assertThat (flags .get ("EmptyArg" )).hasValue ("" );
43+ assertThat (flags .get ("absent" )).isEmpty ();
4544 }
4645
4746 @ Test
@@ -54,17 +53,17 @@ public void parseAndGetBoolean() {
5453 .parseFlag ("-XepOpt:Arg3=yes" )
5554 .parseFlag ("-XepOpt:Arg4" )
5655 .build ();
57- Truth8 . assertThat (flags .getBoolean ("Arg1" )).hasValue (true );
58- Truth8 . assertThat (flags .getBoolean ("Arg2" )).hasValue (false );
56+ assertThat (flags .getBoolean ("Arg1" )).hasValue (true );
57+ assertThat (flags .getBoolean ("Arg2" )).hasValue (false );
5958 assertThrows (IllegalArgumentException .class , () -> flags .getBoolean ("Arg3" ));
60- Truth8 . assertThat (flags .getBoolean ("Arg4" )).hasValue (true );
61- Truth8 . assertThat (flags .getBoolean ("absent" )).isEmpty ();
59+ assertThat (flags .getBoolean ("Arg4" )).hasValue (true );
60+ assertThat (flags .getBoolean ("absent" )).isEmpty ();
6261 }
6362
6463 @ Test
6564 public void parseAndGetImplicitTrue () {
6665 ErrorProneFlags flags = ErrorProneFlags .builder ().parseFlag ("-XepOpt:SomeArg" ).build ();
67- Truth8 . assertThat (flags .getBoolean ("SomeArg" )).hasValue (true );
66+ assertThat (flags .getBoolean ("SomeArg" )).hasValue (true );
6867 }
6968
7069 @ Test
@@ -75,10 +74,10 @@ public void parseAndGetInteger() {
7574 .parseFlag ("-XepOpt:Arg2=20.6" )
7675 .parseFlag ("-XepOpt:Arg3=thirty" )
7776 .build ();
78- Truth8 . assertThat (flags .getInteger ("Arg1" )).hasValue (10 );
77+ assertThat (flags .getInteger ("Arg1" )).hasValue (10 );
7978 assertThrows (NumberFormatException .class , () -> flags .getInteger ("Arg2" ));
8079 assertThrows (NumberFormatException .class , () -> flags .getInteger ("Arg3" ));
81- Truth8 . assertThat (flags .getInteger ("absent" )).isEmpty ();
80+ assertThat (flags .getInteger ("absent" )).isEmpty ();
8281 }
8382
8483 @ Test
@@ -145,13 +144,13 @@ public void enumFlags() {
145144 .parseFlag ("-XepOpt:CaseInsensitiveColours=yellow,green" )
146145 .parseFlag ("-XepOpt:EmptyColours=" )
147146 .build ();
148- Truth8 . assertThat (flags .getEnum ("Colour" , Colour .class )).hasValue (Colour .RED );
149- Truth8 . assertThat (flags .getEnumSet ("Colours" , Colour .class ))
147+ assertThat (flags .getEnum ("Colour" , Colour .class )).hasValue (Colour .RED );
148+ assertThat (flags .getEnumSet ("Colours" , Colour .class ))
150149 .hasValue (ImmutableSet .of (Colour .YELLOW , Colour .GREEN ));
151- Truth8 . assertThat (flags .getEnumSet ("CaseInsensitiveColours" , Colour .class ))
150+ assertThat (flags .getEnumSet ("CaseInsensitiveColours" , Colour .class ))
152151 .hasValue (ImmutableSet .of (Colour .YELLOW , Colour .GREEN ));
153- Truth8 . assertThat (flags .getEnumSet ("EmptyColours" , Colour .class )).hasValue (ImmutableSet .of ());
154- Truth8 . assertThat (flags .getEnumSet ("NoSuchColours" , Colour .class )).isEmpty ();
152+ assertThat (flags .getEnumSet ("EmptyColours" , Colour .class )).hasValue (ImmutableSet .of ());
153+ assertThat (flags .getEnumSet ("NoSuchColours" , Colour .class )).isEmpty ();
155154 }
156155
157156 @ Test
0 commit comments