blob: 3d8ec6f9e6a66ff19eef7d4771102544d62f379d [file] [log] [blame]
andrewsbrownaada3932015-04-01 14:09:51 -07001/*
2 * jndn-mock
Andrew Brownfe6c21c2016-08-24 16:28:54 -07003 * Copyright (c) 2016, Intel Corporation.
andrewsbrownaada3932015-04-01 14:09:51 -07004 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU Lesser General Public License,
7 * version 3, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT ANY
10 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
12 * more details.
13 */
14package com.intel.jndn.mock;
15
16import net.named_data.jndn.Name;
17import net.named_data.jndn.security.KeyChain;
18import org.junit.Test;
Alexander Afanasyevcbc41012016-02-19 20:10:57 -080019
20import static org.junit.Assert.assertEquals;
21import static org.junit.Assert.assertTrue;
andrewsbrownaada3932015-04-01 14:09:51 -070022
23/**
Alexander Afanasyevcbc41012016-02-19 20:10:57 -080024 * Test MockKeyChain.
Andrew Brown58191872016-02-05 22:16:57 -080025 *
andrewsbrownaada3932015-04-01 14:09:51 -070026 * @author Andrew Brown <andrew.brown@intel.com>
27 */
28public class MockKeyChainTest {
29
30 /**
31 * Test of configure method, of class MockKeyChain.
32 */
33 @Test
34 public void testConfigure() throws Exception {
35 String identity = "/test/name";
36 KeyChain keyChain = MockKeyChain.configure(new Name(identity));
37 assertEquals(identity, keyChain.getDefaultIdentity().toUri());
38 assertTrue(keyChain.getDefaultCertificateName().toUri().startsWith(identity));
39 }
40}