Skip to content

Commit

Permalink
Add test for JDBC and additional information in client
Browse files Browse the repository at this point in the history
  • Loading branch information
dsyer committed Nov 19, 2012
1 parent 69a39f3 commit 16a40ae
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 16a40ae

Please sign in to comment.