Replace fest with assertj (#32770)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32770

Fest is EOL and is replaced by assertj, originally a fork of Fest. This change replaces the usages in internal tests and removes the dependency.

Changelog:
[Internal][Android] Replace fest with assertj

Reviewed By: genkikondo

Differential Revision: D33143454

fbshipit-source-id: c1cbe5b064d007018f73858b2913806c11aa08af
This commit is contained in:
Andrei Shikov
2021-12-16 10:40:37 -08:00
committed by Facebook GitHub Bot
parent a4b9e4c978
commit 8367fc3836
42 changed files with 58 additions and 80 deletions
@@ -11,7 +11,7 @@ rn_robolectric_test(
react_native_dep("third-party/android/androidx:fragment"),
react_native_dep("third-party/android/androidx:legacy-support-core-ui"),
react_native_dep("third-party/android/androidx:legacy-support-core-utils"),
react_native_dep("third-party/java/fest:fest"),
react_native_dep("third-party/java/assertj:assertj-core"),
react_native_dep("third-party/java/jsr-305:jsr-305"),
react_native_dep("third-party/java/junit:junit"),
react_native_dep("third-party/java/okhttp:okhttp3"),
@@ -7,7 +7,7 @@
package com.facebook.react;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
@@ -8,7 +8,7 @@ rn_robolectric_test(
"PUBLIC",
],
deps = [
react_native_dep("third-party/java/fest:fest"),
react_native_dep("third-party/java/assertj:assertj-core"),
react_native_dep("third-party/java/jsr-305:jsr-305"),
react_native_dep("third-party/java/junit:junit"),
react_native_target("java/com/facebook/react:react"),
@@ -7,7 +7,7 @@
package com.facebook.react.animated;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -7,7 +7,7 @@
package com.facebook.react.animated;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.eq;
@@ -33,7 +33,7 @@ rn_robolectric_test(
deps = [
":testhelpers",
react_native_dep("libraries/soloader/java/com/facebook/soloader:soloader"),
react_native_dep("third-party/java/fest:fest"),
react_native_dep("third-party/java/assertj:assertj-core"),
react_native_dep("third-party/java/jsr-305:jsr-305"),
react_native_dep("third-party/java/junit:junit"),
react_native_target("java/com/facebook/react/bridge:bridge"),
@@ -7,8 +7,8 @@
package com.facebook.react.bridge;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.fest.assertions.api.Assertions.fail;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
@@ -7,7 +7,7 @@
package com.facebook.react.bridge;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
@@ -8,7 +8,7 @@ rn_robolectric_test(
"PUBLIC",
],
deps = [
react_native_dep("third-party/java/fest:fest"),
react_native_dep("third-party/java/assertj:assertj-core"),
react_native_dep("third-party/java/jsr-305:jsr-305"),
react_native_dep("third-party/java/junit:junit"),
react_native_dep("third-party/java/okhttp:okhttp3"),
@@ -7,7 +7,7 @@
package com.facebook.react.devsupport;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import java.io.IOException;
import java.util.Map;
@@ -7,7 +7,7 @@
package com.facebook.react.devsupport;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import com.facebook.react.devsupport.interfaces.StackFrame;
import org.junit.Test;
@@ -14,7 +14,7 @@ rn_robolectric_test(
react_native_dep("third-party/android/androidx:fragment"),
react_native_dep("third-party/android/androidx:legacy-support-core-ui"),
react_native_dep("third-party/android/androidx:legacy-support-core-utils"),
react_native_dep("third-party/java/fest:fest"),
react_native_dep("third-party/java/assertj:assertj-core"),
react_native_dep("third-party/java/jsr-305:jsr-305"),
react_native_dep("third-party/java/junit:junit"),
react_native_dep("third-party/java/okhttp:okhttp3"),
@@ -7,7 +7,7 @@
package com.facebook.react.modules.deviceinfo;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
@@ -7,7 +7,7 @@
package com.facebook.react.modules.network;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.mock;
@@ -7,7 +7,7 @@
package com.facebook.react.modules.network;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -7,7 +7,7 @@
package com.facebook.react.modules.storage;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import com.facebook.react.bridge.Arguments;
@@ -7,7 +7,7 @@
package com.facebook.react.modules.timing;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.*;
import com.facebook.react.bridge.Arguments;
@@ -8,7 +8,7 @@ rn_robolectric_test(
"PUBLIC",
],
deps = [
react_native_dep("third-party/java/fest:fest"),
react_native_dep("third-party/java/assertj:assertj-core"),
react_native_dep("third-party/java/jsr-305:jsr-305"),
react_native_dep("third-party/java/junit:junit"),
react_native_dep("third-party/java/okhttp:okhttp3"),
@@ -21,7 +21,7 @@ rn_robolectric_test(
react_native_dep("third-party/android/androidx:fragment"),
react_native_dep("third-party/android/androidx:legacy-support-core-ui"),
react_native_dep("third-party/android/androidx:legacy-support-core-utils"),
react_native_dep("third-party/java/fest:fest"),
react_native_dep("third-party/java/assertj:assertj-core"),
react_native_dep("third-party/java/jsr-305:jsr-305"),
react_native_dep("third-party/java/junit:junit"),
react_native_dep("third-party/java/okhttp:okhttp3"),
@@ -7,7 +7,7 @@
package com.facebook.react.uimanager;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import com.facebook.react.R;
import com.facebook.react.bridge.Arguments;
@@ -7,7 +7,7 @@
package com.facebook.react.uimanager;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -7,7 +7,7 @@
package com.facebook.react.uimanager;
import static org.fest.assertions.api.Assertions.fail;
import static org.assertj.core.api.Assertions.fail;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.verify;
@@ -7,8 +7,8 @@
package com.facebook.react.uimanager;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.fest.assertions.api.Assertions.fail;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
import android.view.View;
import com.facebook.react.bridge.ReactApplicationContext;
@@ -7,8 +7,8 @@
package com.facebook.react.uimanager;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.fest.assertions.api.Assertions.offset;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.offset;
import android.graphics.drawable.ColorDrawable;
import android.view.View;
@@ -7,7 +7,7 @@
package com.facebook.react.uimanager;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -16,7 +16,7 @@ import com.facebook.react.common.MapBuilder;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import org.fest.assertions.data.MapEntry;
import org.assertj.core.data.MapEntry;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -7,7 +7,7 @@
package com.facebook.react.uimanager;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
@@ -9,7 +9,7 @@ rn_robolectric_test(
],
deps = [
YOGA_TARGET,
react_native_dep("third-party/java/fest:fest"),
react_native_dep("third-party/java/assertj:assertj-core"),
react_native_dep("third-party/java/junit:junit"),
react_native_target("java/com/facebook/react/uimanager:uimanager"),
],
@@ -7,7 +7,7 @@
package com.facebook.react.uimanager.layoutanimation;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import java.util.Locale;
import org.junit.Test;
@@ -8,7 +8,7 @@ rn_robolectric_test(
"PUBLIC",
],
deps = [
react_native_dep("third-party/java/fest:fest"),
react_native_dep("third-party/java/assertj:assertj-core"),
react_native_dep("third-party/java/jsr-305:jsr-305"),
react_native_dep("third-party/java/junit:junit"),
react_native_target("java/com/facebook/react/util:util"),
@@ -17,7 +17,7 @@ rn_robolectric_test(
react_native_dep("third-party/android/androidx:fragment"),
react_native_dep("third-party/android/androidx:legacy-support-core-ui"),
react_native_dep("third-party/android/androidx:legacy-support-core-utils"),
react_native_dep("third-party/java/fest:fest"),
react_native_dep("third-party/java/assertj:assertj-core"),
react_native_dep("third-party/java/jsr-305:jsr-305"),
react_native_dep("third-party/java/junit:junit"),
react_native_dep("third-party/java/okhttp:okhttp3"),
@@ -7,7 +7,7 @@
package com.facebook.react.views.image;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import com.facebook.drawee.drawable.ScalingUtils;
import org.junit.Rule;
@@ -7,7 +7,7 @@
package com.facebook.react.views.slider;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import android.widget.SeekBar;
import com.facebook.react.bridge.CatalystInstance;
@@ -7,7 +7,7 @@
package com.facebook.react.views.text;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import android.graphics.Paint;
import org.junit.Test;
@@ -7,7 +7,7 @@
package com.facebook.react.views.text;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
@@ -7,7 +7,7 @@
package com.facebook.react.views.textinput;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import android.content.res.ColorStateList;
import android.graphics.Color;
@@ -7,7 +7,7 @@
package com.facebook.react.views.textinput;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;