Permalink
Browse files

Add test for JDBC and additional information in client

  • Loading branch information...
1 parent 69a39f3 commit 16a40ae98cfc211502ffaabb86b59e1e0a597069 @dsyer dsyer committed Nov 19, 2012
@@ -6,6 +6,7 @@
import static org.junit.Assert.assertTrue;
import java.util.Arrays;
+import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
@@ -68,6 +69,17 @@ public void testLoadingClientIdWithNoDetails() {
assertEquals(null, clientDetails.getAccessTokenValiditySeconds());
}
+ @Test
+ public void testLoadingClientIdWithAdditionalInformation() {
+ jdbcTemplate.update(INSERT_SQL, "clientIdWithAddInfo", null, null, null, null, null, null, null, null);
+ jdbcTemplate.update("update oauth_client_details set additional_information=? where client_id=?", "{\"foo\":\"bar\"}", "clientIdWithAddInfo");
+
+ ClientDetails clientDetails = service.loadClientByClientId("clientIdWithAddInfo");
+
+ assertEquals("clientIdWithAddInfo", clientDetails.getClientId());
+ assertEquals(Collections.singletonMap("foo", "bar"), clientDetails.getAdditionalInformation());
+ }
+
@Test
public void testLoadingClientIdWithSingleDetails() {
jdbcTemplate.update(INSERT_SQL, "clientIdWithSingleDetails", "mySecret", "myResource", "myScope",

0 comments on commit 16a40ae

Please sign in to comment.