@Test public void testStoreClients_1() throws Exception { this.cache.clearClients(); final Collection<OAuth2Client> clients = new HashSet<OAuth2Client>(); clients.add(MockUtils.getClient_Code_Confidential()); clients.add(MockUtils.getClient_Code_Public()); this.cache.storeClients(clients); Assert.assertNotNull(this.cache.getClient(MockUtils.GADGET_URI1, MockUtils.SERVICE_NAME)); Assert.assertNotNull(this.cache.getClient(MockUtils.GADGET_URI2, MockUtils.SERVICE_NAME)); }
@Test public void testStoreClients_1() throws Exception { this.cache.clearClients(); final Collection<OAuth2Client> clients = new HashSet<OAuth2Client>(); clients.add(MockUtils.getClient_Code_Confidential()); clients.add(MockUtils.getClient_Code_Public()); this.cache.storeClients(clients); Assert.assertNotNull(this.cache.getClient(MockUtils.GADGET_URI1, MockUtils.SERVICE_NAME)); Assert.assertNotNull(this.cache.getClient(MockUtils.GADGET_URI2, MockUtils.SERVICE_NAME)); }
@Test public void testGetClient_1() throws Exception { final OAuth2Client result = this.cache.getClient(MockUtils.GADGET_URI1, MockUtils.SERVICE_NAME); Assert.assertNotNull(result); Assert.assertEquals(MockUtils.CLIENT_ID1, result.getClientId()); }
@Test public void testGetClient_1() throws Exception { final OAuth2Client result = this.cache.getClient(MockUtils.GADGET_URI1, MockUtils.SERVICE_NAME); Assert.assertNotNull(result); Assert.assertEquals(MockUtils.CLIENT_ID1, result.getClientId()); }
@Test public void testRemoveClient_1() throws Exception { OAuth2Client result = this.cache.getClient(MockUtils.GADGET_URI1, MockUtils.SERVICE_NAME); Assert.assertNotNull(result); result = this.cache.removeClient(result); Assert.assertNotNull(result); result = this.cache.removeClient(result); Assert.assertNull(result); }
@Test public void testRemoveClient_1() throws Exception { OAuth2Client result = this.cache.getClient(MockUtils.GADGET_URI1, MockUtils.SERVICE_NAME); Assert.assertNotNull(result); result = this.cache.removeClient(result); Assert.assertNotNull(result); result = this.cache.removeClient(result); Assert.assertNull(result); }
@Test public void testStoreClient_1() throws Exception { OAuth2Client client = new OAuth2Client(MockUtils.getDummyEncrypter()); client.setGadgetUri("xxx"); client.setServiceName("yyy"); this.cache.storeClient(client); client = this.cache.getClient(client.getGadgetUri(), client.getServiceName()); Assert.assertNotNull(client); Assert.assertEquals("xxx", client.getGadgetUri()); Assert.assertEquals("yyy", client.getServiceName()); }
@Test public void testStoreClient_1() throws Exception { OAuth2Client client = new OAuth2Client(MockUtils.getDummyEncrypter()); client.setGadgetUri("xxx"); client.setServiceName("yyy"); this.cache.storeClient(client); client = this.cache.getClient(client.getGadgetUri(), client.getServiceName()); Assert.assertNotNull(client); Assert.assertEquals("xxx", client.getGadgetUri()); Assert.assertEquals("yyy", client.getServiceName()); }