View Javadoc

1   package com.atlassian.asap.core.client;
2   
3   import org.junit.Rule;
4   import org.junit.Test;
5   import org.junit.rules.ExpectedException;
6   
7   import static org.hamcrest.Matchers.containsString;
8   import static org.hamcrest.Matchers.not;
9   
10  public class AsapClientConfigurationTest {
11      @Rule
12      public final ExpectedException expectedException = ExpectedException.none();
13  
14      @Test
15      public void shouldFailIfPrivateKeyIsNotParseableAsUri() {
16          AsapClientConfiguration asapClientConfiguration = new AsapClientConfiguration("issuer", "keyId");
17  
18          expectedException.expect(IllegalArgumentException.class);
19          expectedException.expectMessage(not(containsString("private key")));
20  
21          asapClientConfiguration.privateKeyProvider("not a private key uri");
22      }
23  }