Skip to content

Commit

Permalink
Rename variables and slightly change tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rickie committed Dec 20, 2022
1 parent 87b0651 commit a5eb9d7
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ void after(boolean condition, String message) {

static final class AssertThatWithFailMessageSupplierIsTrue {
@BeforeTemplate
void before(boolean condition, Supplier<String> messageSupplier) {
assertTrue(condition, messageSupplier);
void before(boolean condition, Supplier<String> supplier) {
assertTrue(condition, supplier);
}

@AfterTemplate
@UseImportPolicy(STATIC_IMPORT_ALWAYS)
void after(boolean condition, Supplier<String> messageSupplier) {
assertThat(condition).withFailMessage(messageSupplier).isTrue();
void after(boolean condition, Supplier<String> supplier) {
assertThat(condition).withFailMessage(supplier).isTrue();
}
}

Expand Down Expand Up @@ -138,14 +138,14 @@ void after(boolean condition, String message) {

static final class AssertThatWithFailMessageSupplierIsFalse {
@BeforeTemplate
void before(boolean condition, Supplier<String> messageSupplier) {
assertFalse(condition, messageSupplier);
void before(boolean condition, Supplier<String> supplier) {
assertFalse(condition, supplier);
}

@AfterTemplate
@UseImportPolicy(STATIC_IMPORT_ALWAYS)
void after(boolean condition, Supplier<String> messageSupplier) {
assertThat(condition).withFailMessage(messageSupplier).isFalse();
void after(boolean condition, Supplier<String> supplier) {
assertThat(condition).withFailMessage(supplier).isFalse();
}
}

Expand Down Expand Up @@ -261,14 +261,14 @@ void after(Object actual, Object expected, String message) {

static final class AssertThatWithFailMessageSupplierIsSameAs {
@BeforeTemplate
void before(Object actual, Object expected, Supplier<String> messageSupplier) {
assertSame(expected, actual, messageSupplier);
void before(Object actual, Object expected, Supplier<String> supplier) {
assertSame(expected, actual, supplier);
}

@AfterTemplate
@UseImportPolicy(STATIC_IMPORT_ALWAYS)
void after(Object actual, Object expected, Supplier<String> messageSupplier) {
assertThat(actual).withFailMessage(messageSupplier).isSameAs(expected);
void after(Object actual, Object expected, Supplier<String> supplier) {
assertThat(actual).withFailMessage(supplier).isSameAs(expected);
}
}

Expand Down Expand Up @@ -300,14 +300,14 @@ void after(Object actual, Object expected, String message) {

static final class AssertThatWithFailMessageSupplierIsNotSameAs {
@BeforeTemplate
void before(Object actual, Object expected, Supplier<String> messageSupplier) {
assertNotSame(expected, actual, messageSupplier);
void before(Object actual, Object expected, Supplier<String> supplier) {
assertNotSame(expected, actual, supplier);
}

@AfterTemplate
@UseImportPolicy(STATIC_IMPORT_ALWAYS)
void after(Object actual, Object expected, Supplier<String> messageSupplier) {
assertThat(actual).withFailMessage(messageSupplier).isNotSameAs(expected);
void after(Object actual, Object expected, Supplier<String> supplier) {
assertThat(actual).withFailMessage(supplier).isNotSameAs(expected);
}
}

Expand Down Expand Up @@ -344,14 +344,14 @@ void after(ThrowingCallable runnable, Class<T> clazz, String message) {
static final class AssertThatThrownByWithFailMessageSupplierIsExactlyInstanceOf<
T extends Throwable> {
@BeforeTemplate
void before(Executable runnable, Class<T> clazz, Supplier<String> messageSupplier) {
assertThrowsExactly(clazz, runnable, messageSupplier);
void before(Executable runnable, Class<T> clazz, Supplier<String> supplier) {
assertThrowsExactly(clazz, runnable, supplier);
}

@AfterTemplate
@UseImportPolicy(STATIC_IMPORT_ALWAYS)
void after(ThrowingCallable runnable, Class<T> clazz, Supplier<String> messageSupplier) {
assertThatThrownBy(runnable).withFailMessage(messageSupplier).isExactlyInstanceOf(clazz);
void after(ThrowingCallable runnable, Class<T> clazz, Supplier<String> supplier) {
assertThatThrownBy(runnable).withFailMessage(supplier).isExactlyInstanceOf(clazz);
}
}

Expand Down Expand Up @@ -383,14 +383,14 @@ void after(ThrowingCallable runnable, Class<T> clazz, String message) {

static final class AssertThatThrownByWithFailMessageSupplierIsInstanceOf<T extends Throwable> {
@BeforeTemplate
void before(Executable runnable, Class<T> clazz, Supplier<String> messageSupplier) {
assertThrows(clazz, runnable, messageSupplier);
void before(Executable runnable, Class<T> clazz, Supplier<String> supplier) {
assertThrows(clazz, runnable, supplier);
}

@AfterTemplate
@UseImportPolicy(STATIC_IMPORT_ALWAYS)
void after(ThrowingCallable runnable, Class<T> clazz, Supplier<String> messageSupplier) {
assertThatThrownBy(runnable).withFailMessage(messageSupplier).isInstanceOf(clazz);
void after(ThrowingCallable runnable, Class<T> clazz, Supplier<String> supplier) {
assertThatThrownBy(runnable).withFailMessage(supplier).isInstanceOf(clazz);
}
}

Expand Down Expand Up @@ -432,19 +432,19 @@ void after(ThrowingCallable runnable, String message) {

static final class AssertThatCodeWithFailMessageSupplierDoesNotThrowAnyException {
@BeforeTemplate
void before(Executable runnable, Supplier<String> messageSupplier) {
assertDoesNotThrow(runnable, messageSupplier);
void before(Executable runnable, Supplier<String> supplier) {
assertDoesNotThrow(runnable, supplier);
}

@BeforeTemplate
void before(ThrowingSupplier<?> runnable, Supplier<String> messageSupplier) {
assertDoesNotThrow(runnable, messageSupplier);
void before(ThrowingSupplier<?> runnable, Supplier<String> supplier) {
assertDoesNotThrow(runnable, supplier);
}

@AfterTemplate
@UseImportPolicy(STATIC_IMPORT_ALWAYS)
void after(ThrowingCallable runnable, Supplier<String> messageSupplier) {
assertThatCode(runnable).withFailMessage(messageSupplier).doesNotThrowAnyException();
void after(ThrowingCallable runnable, Supplier<String> supplier) {
assertThatCode(runnable).withFailMessage(supplier).doesNotThrowAnyException();
}
}

Expand Down Expand Up @@ -479,14 +479,14 @@ void after(Object object, Class<T> clazz, String message) {

static final class AssertThatWithFailMessageSupplierIsInstanceOf<T> {
@BeforeTemplate
void before(Object object, Class<T> clazz, Supplier<String> messageSupplier) {
assertInstanceOf(clazz, object, messageSupplier);
void before(Object object, Class<T> clazz, Supplier<String> supplier) {
assertInstanceOf(clazz, object, supplier);
}

@AfterTemplate
@UseImportPolicy(STATIC_IMPORT_ALWAYS)
void after(Object object, Class<T> clazz, Supplier<String> messageSupplier) {
assertThat(object).withFailMessage(messageSupplier).isInstanceOf(clazz);
void after(Object object, Class<T> clazz, Supplier<String> supplier) {
assertThat(object).withFailMessage(supplier).isInstanceOf(clazz);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ final class JUnitToAssertJRulesTest implements RefasterRuleCollectionTestCase {
public ImmutableSet<?> elidedTypesAndStaticImports() {
return ImmutableSet.of(
(Runnable) () -> assertDoesNotThrow(() -> null),
(Runnable) () -> assertFalse(true),
(Runnable) () -> assertInstanceOf(null, null),
(Runnable) () -> assertNotNull(null),
(Runnable) () -> assertNotSame(null, null),
(Runnable) () -> assertNull(null),
(Runnable) () -> assertSame(null, null),
(Runnable) () -> assertThrows(null, null),
(Runnable) () -> assertThrowsExactly(null, null),
(Runnable) () -> assertTrue(true),
(Runnable) () -> Assertions.fail());
() -> assertFalse(true),
() -> assertInstanceOf(null, null),
() -> assertNotNull(null),
() -> assertNotSame(null, null),
() -> assertNull(null),
() -> assertSame(null, null),
() -> assertThrows(null, null),
() -> assertThrowsExactly(null, null),
() -> assertTrue(true),
() -> Assertions.fail());
}

void testThrowNewAssertionError() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ final class JUnitToAssertJRulesTest implements RefasterRuleCollectionTestCase {
public ImmutableSet<?> elidedTypesAndStaticImports() {
return ImmutableSet.of(
(Runnable) () -> assertDoesNotThrow(() -> null),
(Runnable) () -> assertFalse(true),
(Runnable) () -> assertInstanceOf(null, null),
(Runnable) () -> assertNotNull(null),
(Runnable) () -> assertNotSame(null, null),
(Runnable) () -> assertNull(null),
(Runnable) () -> assertSame(null, null),
(Runnable) () -> assertThrows(null, null),
(Runnable) () -> assertThrowsExactly(null, null),
(Runnable) () -> assertTrue(true),
(Runnable) () -> Assertions.fail());
() -> assertFalse(true),
() -> assertInstanceOf(null, null),
() -> assertNotNull(null),
() -> assertNotSame(null, null),
() -> assertNull(null),
() -> assertSame(null, null),
() -> assertThrows(null, null),
() -> assertThrowsExactly(null, null),
() -> assertTrue(true),
() -> Assertions.fail());
}

void testThrowNewAssertionError() {
Expand Down

0 comments on commit a5eb9d7

Please sign in to comment.