diff --git a/smoke-tests/build.gradle b/smoke-tests/build.gradle index a4b4a045137..26065bbba09 100644 --- a/smoke-tests/build.gradle +++ b/smoke-tests/build.gradle @@ -50,12 +50,6 @@ android { } } - // As required by Firebase Android Smart Reply doc: - // https://firebase.google.com/docs/ml-kit/android/generate-smart-replies#before-you-begin - aaptOptions { - noCompress "tflite" - } - if (project.hasProperty("testBuildType")) { testBuildType project.getProperty("testBuildType") } @@ -75,9 +69,8 @@ dependencies { implementation "com.google.firebase:firebase-firestore" implementation "com.google.firebase:firebase-functions" implementation "com.google.firebase:firebase-inappmessaging" - implementation "com.google.firebase:firebase-messaging" - implementation "com.google.firebase:firebase-ml-natural-language" - implementation "com.google.firebase:firebase-ml-natural-language-smart-reply-model" + // TODO(yifany): Remove version after messaging is up to date + implementation "com.google.firebase:firebase-messaging:21.0.0" implementation "com.google.firebase:firebase-ml-vision" implementation "com.google.firebase:firebase-perf" implementation "com.google.firebase:firebase-storage" diff --git a/smoke-tests/src/main/java/com/google/firebase/testing/BuildOnlyTest.java b/smoke-tests/src/main/java/com/google/firebase/testing/BuildOnlyTest.java index f59cdb0776c..07cecef26e3 100644 --- a/smoke-tests/src/main/java/com/google/firebase/testing/BuildOnlyTest.java +++ b/smoke-tests/src/main/java/com/google/firebase/testing/BuildOnlyTest.java @@ -19,7 +19,6 @@ import com.google.firebase.appindexing.FirebaseAppIndex; import com.google.firebase.inappmessaging.FirebaseInAppMessaging; import com.google.firebase.messaging.FirebaseMessaging; -import com.google.firebase.ml.naturallanguage.FirebaseNaturalLanguage; import com.google.firebase.perf.FirebasePerformance; import com.google.firebase.ml.vision.FirebaseVision; import org.junit.Test; @@ -50,11 +49,6 @@ public void performance_IsNotNull() { assertThat(FirebasePerformance.getInstance()).isNotNull(); } - @Test - public void naturalLanguage_IsNotNull() { - assertThat(FirebaseNaturalLanguage.getInstance()).isNotNull(); - } - @Test public void vision_IsNotNull() { assertThat(FirebaseVision.getInstance()).isNotNull(); diff --git a/smoke-tests/src/main/java/com/google/firebase/testing/SmartReplyTest.java b/smoke-tests/src/main/java/com/google/firebase/testing/SmartReplyTest.java deleted file mode 100644 index 215c06d1e60..00000000000 --- a/smoke-tests/src/main/java/com/google/firebase/testing/SmartReplyTest.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.firebase.testing; - -import static com.google.common.truth.Truth.assertThat; - -import android.app.Activity; -import androidx.test.rule.ActivityTestRule; -import androidx.test.runner.AndroidJUnit4; -import com.google.android.gms.tasks.Task; -import com.google.firebase.ml.naturallanguage.FirebaseNaturalLanguage; -import com.google.firebase.ml.naturallanguage.smartreply.FirebaseSmartReply; -import com.google.firebase.ml.naturallanguage.smartreply.FirebaseTextMessage; -import com.google.firebase.ml.naturallanguage.smartreply.SmartReplySuggestion; -import com.google.firebase.ml.naturallanguage.smartreply.SmartReplySuggestionResult; -import com.google.firebase.testing.common.Tasks2; -import java.util.Arrays; -import java.util.List; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; - -@RunWith(AndroidJUnit4.class) -public final class SmartReplyTest { - - private static final String REMOTE_USER_ID = "some_user_id"; - private static final FirebaseSmartReply smartReply = - FirebaseNaturalLanguage.getInstance().getSmartReply(); - - @Rule public final ActivityTestRule activity = new ActivityTestRule<>(Activity.class); - - @Test - public void suggestReplies_English_Success() throws Exception { - List messages = Arrays.asList( - FirebaseTextMessage.createForRemoteUser( - "Can I help you?", System.currentTimeMillis(), REMOTE_USER_ID), - FirebaseTextMessage.createForLocalUser( - "No, you can't.", System.currentTimeMillis()), - FirebaseTextMessage.createForRemoteUser( - "Cheers!", System.currentTimeMillis(), REMOTE_USER_ID)); - Task task = smartReply.suggestReplies(messages); - - SmartReplySuggestionResult result = Tasks2.waitForSuccess(task); - List suggestions = result.getSuggestions(); - - assertThat(result.getStatus()).isEqualTo(SmartReplySuggestionResult.STATUS_SUCCESS); - assertThat(suggestions).isNotEmpty(); - } - - @Test - public void suggestReplies_Espanol_NotSupported() throws Exception { - List messages = Arrays.asList( - FirebaseTextMessage.createForLocalUser( - "Donede estas?", System.currentTimeMillis()), - FirebaseTextMessage.createForRemoteUser( - "Tengo tres manzanas", System.currentTimeMillis(), REMOTE_USER_ID)); - Task task = smartReply.suggestReplies(messages); - - SmartReplySuggestionResult result = Tasks2.waitForSuccess(task); - - assertThat(result.getStatus()).isEqualTo( - SmartReplySuggestionResult.STATUS_NOT_SUPPORTED_LANGUAGE); - } - -} diff --git a/smoke-tests/src/main/java/com/google/firebase/testing/TestSuite.java b/smoke-tests/src/main/java/com/google/firebase/testing/TestSuite.java index 77b070b03c2..9fb98b58476 100644 --- a/smoke-tests/src/main/java/com/google/firebase/testing/TestSuite.java +++ b/smoke-tests/src/main/java/com/google/firebase/testing/TestSuite.java @@ -31,7 +31,6 @@ FunctionsTest.class, PerformanceMonitoringTest.class, RemoteConfigTest.class, - SmartReplyTest.class, StorageTest.class, }) public final class TestSuite {}