andrewsbrown | aada393 | 2015-04-01 14:09:51 -0700 | [diff] [blame^] | 1 | /* |
| 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 | */ |
| 14 | package com.intel.jndn.mock; |
| 15 | |
| 16 | import net.named_data.jndn.Name; |
| 17 | import net.named_data.jndn.security.KeyChain; |
| 18 | import org.junit.Test; |
| 19 | import static org.junit.Assert.*; |
| 20 | |
| 21 | /** |
| 22 | * Test MockKeyChain |
| 23 | * @author Andrew Brown <andrew.brown@intel.com> |
| 24 | */ |
| 25 | public 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 | } |