blob: 137d1b4759975c8b57ad55f6722b02ec7d286590 [file] [log] [blame]
andrewsbrownaada3932015-04-01 14:09:51 -07001/*
2 * jndn-mock
3 * Copyright (c) 2015, Intel Corporation.
4 *
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;
19import static org.junit.Assert.*;
20
21/**
22 * Test MockKeyChain
23 * @author Andrew Brown <andrew.brown@intel.com>
24 */
25public class MockKeyChainTest {
26
27 /**
28 * Test of configure method, of class MockKeyChain.
29 */
30 @Test
31 public void testConfigure() throws Exception {
32 String identity = "/test/name";
33 KeyChain keyChain = MockKeyChain.configure(new Name(identity));
34 assertEquals(identity, keyChain.getDefaultIdentity().toUri());
35 assertTrue(keyChain.getDefaultCertificateName().toUri().startsWith(identity));
36 }
37}