Skip to content

Commit 2cdabc5

Browse files
committed
add unit tests for appchecktokenoptions
1 parent c2818a9 commit 2cdabc5

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright 2026 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.firebase.appcheck;
18+
19+
import static org.junit.Assert.assertFalse;
20+
import static org.junit.Assert.assertNotNull;
21+
import static org.junit.Assert.assertTrue;
22+
23+
import org.junit.Test;
24+
25+
public class VerifyAppCheckTokenOptionsTest {
26+
27+
@Test
28+
public void testDefaultBuilder_EmptyConsume() {
29+
VerifyAppCheckTokenOptions options = VerifyAppCheckTokenOptions.builder().build();
30+
assertNotNull(options);
31+
assertFalse(options.getConsume().isPresent());
32+
}
33+
34+
@Test
35+
public void testBuilder_SetConsumeTrue() {
36+
VerifyAppCheckTokenOptions options =
37+
VerifyAppCheckTokenOptions.builder().setConsume(true).build();
38+
assertNotNull(options);
39+
assertTrue(options.getConsume().isPresent());
40+
assertTrue(options.getConsume().get());
41+
}
42+
43+
@Test
44+
public void testBuilder_SetConsumeFalse() {
45+
VerifyAppCheckTokenOptions options =
46+
VerifyAppCheckTokenOptions.builder().setConsume(false).build();
47+
assertNotNull(options);
48+
assertTrue(options.getConsume().isPresent());
49+
assertFalse(options.getConsume().get());
50+
}
51+
}

0 commit comments

Comments
 (0)