mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-28 01:24:03 +03:00
fix tests
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
69fc02b0cb
commit
ffe41182d1
2 changed files with 6 additions and 12 deletions
|
@ -1,9 +1,9 @@
|
|||
package com.nextcloud.talk.activities
|
||||
|
||||
import androidx.test.espresso.intent.rule.IntentsTestRule
|
||||
import com.nextcloud.talk.data.user.model.UserNgEntity
|
||||
import com.nextcloud.talk.data.user.model.User
|
||||
import com.nextcloud.talk.users.UserManager
|
||||
import io.reactivex.Observer
|
||||
import io.reactivex.SingleObserver
|
||||
import io.reactivex.disposables.Disposable
|
||||
import org.junit.Assert.fail
|
||||
import org.junit.Rule
|
||||
|
@ -35,12 +35,12 @@ class MainActivityTest {
|
|||
certificateAlias = null,
|
||||
externalSignalingServer = null
|
||||
)
|
||||
).subscribe(object : Observer<UserNgEntity?> {
|
||||
).subscribe(object : SingleObserver<User?> {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
// unused atm
|
||||
}
|
||||
|
||||
override fun onNext(user: UserNgEntity) {
|
||||
override fun onSuccess(user: User) {
|
||||
sut.runOnUiThread { sut.resetConversationsList() }
|
||||
|
||||
println("User: " + user.id + " / " + user.userId + " / " + user.baseUrl)
|
||||
|
@ -49,10 +49,6 @@ class MainActivityTest {
|
|||
override fun onError(e: Throwable) {
|
||||
fail("No user created")
|
||||
}
|
||||
|
||||
override fun onComplete() {
|
||||
// unused atm
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,8 +29,6 @@ import android.os.Bundle;
|
|||
import com.nextcloud.talk.R;
|
||||
import com.nextcloud.talk.activities.MainActivity;
|
||||
|
||||
import junit.framework.AssertionFailedError;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.Objects;
|
||||
|
@ -52,7 +50,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withText;
|
|||
import static androidx.test.espresso.web.sugar.Web.onWebView;
|
||||
import static androidx.test.espresso.web.webdriver.DriverAtoms.findElement;
|
||||
import static androidx.test.espresso.web.webdriver.DriverAtoms.webClick;
|
||||
import static org.hamcrest.Matchers.not;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
|
||||
|
@ -143,7 +140,8 @@ public class LoginIT {
|
|||
onView(withId(R.id.user_name)).check(matches(withText("User One")));
|
||||
|
||||
activityScenario.onActivity(activity -> {
|
||||
assertEquals(loginName, Objects.requireNonNull(activity.userManager.getCurrentUser().blockingFirst()).getUserId());
|
||||
assertEquals(loginName,
|
||||
Objects.requireNonNull(activity.userManager.getCurrentUser().blockingGet()).getUserId());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue