andrewsbrown | aada393 | 2015-04-01 14:09:51 -0700 | [diff] [blame] | 1 | /* |
| 2 | * jndn-mock |
Andrew Brown | fe6c21c | 2016-08-24 16:28:54 -0700 | [diff] [blame] | 3 | * Copyright (c) 2016, Intel Corporation. |
andrewsbrown | aada393 | 2015-04-01 14:09:51 -0700 | [diff] [blame] | 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; |
Alexander Afanasyev | cbc4101 | 2016-02-19 20:10:57 -0800 | [diff] [blame] | 19 | |
| 20 | import static org.junit.Assert.assertEquals; |
| 21 | import static org.junit.Assert.assertTrue; |
andrewsbrown | aada393 | 2015-04-01 14:09:51 -0700 | [diff] [blame] | 22 | |
| 23 | /** |
Alexander Afanasyev | cbc4101 | 2016-02-19 20:10:57 -0800 | [diff] [blame] | 24 | * Test MockKeyChain. |
Andrew Brown | 5819187 | 2016-02-05 22:16:57 -0800 | [diff] [blame] | 25 | * |
Andrew Brown | c9ba550 | 2016-08-25 09:40:53 -0700 | [diff] [blame] | 26 | * @author Andrew Brown, andrew.brown@intel.com |
andrewsbrown | aada393 | 2015-04-01 14:09:51 -0700 | [diff] [blame] | 27 | */ |
| 28 | public 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 | } |