use of org.easymock.IMocksControl in project cxf by apache.
the class LDAPCertificateRepoTest method testSaveServiceCert.
@Test
public void testSaveServiceCert() throws Exception {
IMocksControl c = EasyMock.createControl();
LdapSearch ldapSearch = c.createMock(LdapSearch.class);
ldapSearch.bind(EasyMock.eq(EXPECTED_DN_FOR_SERVICE + "," + ROOT_DN), EasyMock.anyObject(Attributes.class));
EasyMock.expectLastCall().once();
LdapCertificateRepo ldapCertRepo = new LdapCertificateRepo(ldapSearch, LDAP_CERT_CONFIG, ROOT_DN);
X509Certificate cert = getTestCert();
c.replay();
UseKeyWithType key = new UseKeyWithType();
key.setApplication(Applications.SERVICE_NAME.getUri());
key.setIdentifier(EXPECTED_SERVICE_URI);
ldapCertRepo.saveCertificate(cert, key);
c.verify();
}
use of org.easymock.IMocksControl in project cxf by apache.
the class LDAPCertificateRepoTest method testSaveUserCert.
@Test
public void testSaveUserCert() throws Exception {
IMocksControl c = EasyMock.createControl();
LdapSearch ldapSearch = c.createMock(LdapSearch.class);
ldapSearch.bind(EasyMock.eq(EXPECTED_SUBJECT_DN2 + "," + ROOT_DN), EasyMock.anyObject(Attributes.class));
EasyMock.expectLastCall().once();
LdapCertificateRepo ldapCertRepo = new LdapCertificateRepo(ldapSearch, LDAP_CERT_CONFIG, ROOT_DN);
X509Certificate cert = getTestCert();
c.replay();
UseKeyWithType key = new UseKeyWithType();
key.setApplication(Applications.PKIX.getUri());
key.setIdentifier(EXPECTED_SUBJECT_DN2);
ldapCertRepo.saveCertificate(cert, key);
c.verify();
}
use of org.easymock.IMocksControl in project cxf by apache.
the class CorbaBindingFactoryTest method testCreateBinding.
@Test
public void testCreateBinding() throws Exception {
IMocksControl control = EasyMock.createNiceControl();
BindingInfo bindingInfo = control.createMock(BindingInfo.class);
CorbaBinding binding = (CorbaBinding) factory.createBinding(bindingInfo);
assertNotNull(binding);
assertTrue(CorbaBinding.class.isInstance(binding));
List<Interceptor<? extends Message>> inInterceptors = binding.getInInterceptors();
assertNotNull(inInterceptors);
List<Interceptor<? extends Message>> outInterceptors = binding.getOutInterceptors();
assertNotNull(outInterceptors);
assertEquals(2, inInterceptors.size());
assertEquals(2, outInterceptors.size());
}
use of org.easymock.IMocksControl in project janusgraph by JanusGraph.
the class LockCleanerRunnableTest method setupMocks.
@Before
public void setupMocks() {
IMocksControl relaxedCtrl = EasyMock.createControl();
tx = relaxedCtrl.createMock(StoreTransaction.class);
ctrl = EasyMock.createStrictControl();
store = ctrl.createMock(KeyColumnValueStore.class);
}
use of org.easymock.IMocksControl in project janusgraph by JanusGraph.
the class LockCleanerServiceTest method setupMocks.
@Before
public void setupMocks() {
IMocksControl relaxedCtrl = EasyMock.createControl();
tx = relaxedCtrl.createMock(StoreTransaction.class);
ctrl = EasyMock.createStrictControl();
store = ctrl.createMock(KeyColumnValueStore.class);
exec = ctrl.createMock(ExecutorService.class);
}
Aggregations