- @Test
- public void testCreateBeanWithMD5() throws Exception {
- NativeTestSupport.assumeSupportedPlatform();
- final CommitStatus status = createBgpPeerInstance(true);
- assertBeanCount(1, FACTORY_NAME);
- assertStatus(status, 23, 0, 0);
- }
-
- @Test
- public void testMD5ValidationFailure() throws Exception {
- NativeTestSupport.assumeSupportedPlatform();
- createBgpPeerInstance(true);
- // now remove md5 from dispatcher
- final ConfigTransactionJMXClient transaction = this.configRegistryClient.createTransaction();
- final ObjectName nameCreated = transaction.lookupConfigBean(FACTORY_NAME, INSTANCE_NAME);
- final BGPPeerModuleMXBean mxBean = transaction.newMXBeanProxy(nameCreated, BGPPeerModuleMXBean.class);
- final BGPDispatcherImplModuleMXBean bgpDispatcherImplModuleMXBean = getBgpDispatcherImplModuleMXBean(transaction, mxBean);
- bgpDispatcherImplModuleMXBean.setMd5ChannelFactory(null);
- try {
- transaction.validateConfig();
- fail();
- } catch (final ValidationException e) {
- assertTrue(e.getMessage(), e.getMessage().contains("Underlying dispatcher does not support MD5 clients"));
- }
- }
-