|
| 1 | +// Copyright 2022 Google LLC |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | +package com.google.firebase.appcheck.playintegrity; |
| 16 | + |
| 17 | +import static com.google.common.truth.Truth.assertThat; |
| 18 | + |
| 19 | +import com.google.firebase.FirebaseApp; |
| 20 | +import com.google.firebase.components.Component; |
| 21 | +import com.google.firebase.components.Dependency; |
| 22 | +import java.util.List; |
| 23 | +import org.junit.Test; |
| 24 | +import org.junit.runner.RunWith; |
| 25 | +import org.robolectric.RobolectricTestRunner; |
| 26 | + |
| 27 | +/** Tests for {@link FirebaseAppCheckPlayIntegrityRegistrar}. */ |
| 28 | +@RunWith(RobolectricTestRunner.class) |
| 29 | +public class FirebaseAppCheckPlayIntegrityRegistrarTest { |
| 30 | + @Test |
| 31 | + public void testGetComponents() { |
| 32 | + FirebaseAppCheckPlayIntegrityRegistrar registrar = new FirebaseAppCheckPlayIntegrityRegistrar(); |
| 33 | + List<Component<?>> components = registrar.getComponents(); |
| 34 | + assertThat(components).isNotEmpty(); |
| 35 | + assertThat(components).hasSize(2); |
| 36 | + Component<?> appCheckPlayIntegrityComponent = components.get(0); |
| 37 | + assertThat(appCheckPlayIntegrityComponent.getDependencies()) |
| 38 | + .containsExactly(Dependency.required(FirebaseApp.class)); |
| 39 | + assertThat(appCheckPlayIntegrityComponent.isLazy()).isTrue(); |
| 40 | + } |
| 41 | +} |
0 commit comments