groovy
testImplementation 'org.assertj:assertj-core:3.21.0'
testImplementation 'org.assertj:assertj-android:3.21.0'
import org.junit.Test;
import static org.assertj.android.api.Assertions.assertThat;
public class NetworkUtilsTest {
@Test
public void testIsNetworkAvailable() {
boolean result = NetworkUtils.isNetworkAvailable();
assertThat(result).isTrue();
}
@Test
public void testGetIpAddress() {
String ipAddress = NetworkUtils.getIpAddress();
assertThat(ipAddress).isEqualTo("192.168.0.1");
}
}