File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
main/java/com/databricks/sdk/core/oauth
test/java/com/databricks/sdk/core/oauth Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -15,11 +15,16 @@ public class IDToken {
1515 */
1616 public IDToken (String value ) {
1717 if (value == null || value .isEmpty ()) {
18- throw new IllegalArgumentException ("ID Token value cannot be null or empty" );
18+ throw new IllegalArgumentException ("ID Token value cannot be null or empty" );
1919 }
2020 this .value = value ;
2121 }
2222
23+ /**
24+ * Returns the value of the ID Token.
25+ *
26+ * @return The string representation of the ID Token.
27+ */
2328 public String getValue () {
2429 return value ;
2530 }
Original file line number Diff line number Diff line change 11package com .databricks .sdk .core .oauth ;
22
33import static org .junit .jupiter .api .Assertions .assertEquals ;
4+ import static org .junit .jupiter .api .Assertions .assertThrows ;
45
56import org .junit .jupiter .api .Test ;
67
@@ -9,8 +10,13 @@ public class IDTokenTest {
910 private static final String accessToken = "testIdToken" ;
1011
1112 @ Test
12- void createIDToken () {
13+ void testIDTokenWithValue () {
1314 IDToken idToken = new IDToken (accessToken );
1415 assertEquals (accessToken , idToken .getValue ());
1516 }
17+
18+ @ Test
19+ void testIDTokenWithNullValue () {
20+ assertThrows (IllegalArgumentException .class , () -> new IDToken (null ));
21+ }
1622}
You can’t perform that action at this time.
0 commit comments