1 /* 2 * Copyright (C) 2021 The Android Open Source Project 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 android.net.ipsec.ike.ike3gpp; 18 19 import static org.junit.Assert.assertArrayEquals; 20 import static org.junit.Assert.assertEquals; 21 22 import com.android.internal.util.HexDump; 23 24 import org.junit.Before; 25 import org.junit.Test; 26 27 public class Ike3gppN1ModeInformationTest { 28 private static final byte[] SNSSAI = HexDump.hexStringToByteArray("1122334455"); 29 30 private Ike3gppN1ModeInformation mN1ModeInformation; 31 newN1ModeInformation()32 public static Ike3gppN1ModeInformation newN1ModeInformation() { 33 return new Ike3gppN1ModeInformation(SNSSAI); 34 } 35 36 @Before setUp()37 public void setUp() { 38 mN1ModeInformation = newN1ModeInformation(); 39 } 40 41 @Test testGetDataType()42 public void testGetDataType() { 43 assertEquals( 44 Ike3gppData.DATA_TYPE_NOTIFY_N1_MODE_INFORMATION, mN1ModeInformation.getDataType()); 45 } 46 47 @Test testGetSnssai()48 public void testGetSnssai() { 49 assertArrayEquals(SNSSAI, mN1ModeInformation.getSnssai()); 50 } 51 } 52