Tabnine Logo
DefaultSecurityTokenCodecTest$FakeContainerConfig.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.apache.shindig.auth.DefaultSecurityTokenCodecTest$FakeContainerConfig
constructor

Best Java code snippets using org.apache.shindig.auth.DefaultSecurityTokenCodecTest$FakeContainerConfig.<init> (Showing top 20 results out of 315)

origin: org.gatein.shindig/shindig-common

 @Test
 public void testRealDecoder() throws Exception {
  // Just verifies that "secure" tokens get routed to the right decoder class.
  try {
   new DefaultSecurityTokenCodec(new FakeContainerConfig("secure"));
   fail("Should have thrown");
  } catch (RuntimeException e) {
   assertTrue("root cause should have been FileNotFoundException: " + e,
     e.getMessage().contains("FileNotFoundException: container key file: somecontainer"));
  }
 }
}
origin: org.gatein.shindig/shindig-common

@Test
public void testInvalidDecoder() throws Exception {
 try {
  new DefaultSecurityTokenCodec(new FakeContainerConfig("garbage"));
  fail("Should have thrown");
 } catch (RuntimeException e) {
  assertTrue("exception should contain garbage: " + e, e.getMessage().contains("garbage"));
 }
}
origin: org.apache.shindig/shindig-common

@Test
public void testInvalidDecoder() throws Exception {
 try {
  new DefaultSecurityTokenCodec(new FakeContainerConfig("garbage"));
  fail("Should have thrown");
 } catch (RuntimeException e) {
  assertTrue("exception should contain garbage: " + e, e.getMessage().contains("garbage"));
 }
}
origin: org.apache.shindig/shindig-common

@Test
public void testBasicDecoder() throws Exception {
 DefaultSecurityTokenCodec codec = new DefaultSecurityTokenCodec(
   new FakeContainerConfig("insecure"));
 Long expires = System.currentTimeMillis() / 1000 + 500; // 50 seconds in the future
 String token = "o:v:app:domain:appurl:12345:container:" +  Long.toString(expires, 10);
 Map<String, String> parameters = Collections.singletonMap(
   SecurityTokenCodec.SECURITY_TOKEN_NAME, token);
 SecurityToken st = codec.createToken(parameters);
 assertEquals("o", st.getOwnerId());
 assertEquals("v", st.getViewerId());
 assertEquals("appurl", st.getAppUrl());
 assertEquals("container", st.getContainer());
 assertEquals(expires, st.getExpiresAt());
}
origin: apache/shindig

@Test
public void testBasicDecoder() throws Exception {
 DefaultSecurityTokenCodec codec = new DefaultSecurityTokenCodec(
   new FakeContainerConfig("insecure"));
 Long expires = System.currentTimeMillis() / 1000 + 500; // 50 seconds in the future
 String token = "o:v:app:domain:appurl:12345:container:" +  Long.toString(expires, 10);
 Map<String, String> parameters = Collections.singletonMap(
   SecurityTokenCodec.SECURITY_TOKEN_NAME, token);
 SecurityToken st = codec.createToken(parameters);
 assertEquals("o", st.getOwnerId());
 assertEquals("v", st.getViewerId());
 assertEquals("appurl", st.getAppUrl());
 assertEquals("container", st.getContainer());
 assertEquals(expires, st.getExpiresAt());
}
origin: org.wso2.org.apache.shindig/shindig-common

@Test
public void testBasicDecoder() throws Exception {
 DefaultSecurityTokenCodec codec = new DefaultSecurityTokenCodec(
   new FakeContainerConfig("insecure"));
 Long expires = System.currentTimeMillis() / 1000 + 500; // 50 seconds in the future
 String token = "o:v:app:domain:appurl:12345:container:" +  Long.toString(expires, 10);
 Map<String, String> parameters = Collections.singletonMap(
   SecurityTokenCodec.SECURITY_TOKEN_NAME, token);
 SecurityToken st = codec.createToken(parameters);
 assertEquals("o", st.getOwnerId());
 assertEquals("v", st.getViewerId());
 assertEquals("appurl", st.getAppUrl());
 assertEquals("container", st.getContainer());
 assertEquals(expires, st.getExpiresAt());
}
origin: org.gatein.shindig/shindig-common

@Test
public void testBasicDecoder() throws Exception {
 DefaultSecurityTokenCodec codec = new DefaultSecurityTokenCodec(
   new FakeContainerConfig("insecure"));
 String token = "o:v:app:domain:appurl:12345:container";
 Map<String, String> parameters = Collections.singletonMap(
   SecurityTokenCodec.SECURITY_TOKEN_NAME, token);
 SecurityToken st = codec.createToken(parameters);
 assertEquals("o", st.getOwnerId());
 assertEquals("v", st.getViewerId());
 assertEquals("appurl", st.getAppUrl());
 assertEquals("container", st.getContainer());
}
origin: com.lmco.shindig/shindig-common

@Test
public void testBasicDecoder() throws Exception {
 DefaultSecurityTokenCodec codec = new DefaultSecurityTokenCodec(
   new FakeContainerConfig("insecure"));
 String token = "o:v:app:domain:appurl:12345:container";
 Map<String, String> parameters = Collections.singletonMap(
   SecurityTokenCodec.SECURITY_TOKEN_NAME, token);
 SecurityToken st = codec.createToken(parameters);
 assertEquals("o", st.getOwnerId());
 assertEquals("v", st.getViewerId());
 assertEquals("appurl", st.getAppUrl());
 assertEquals("container", st.getContainer());
}
origin: apache/shindig

 @Test
 public void testRealDecoder() throws Exception {
  // Just verifies that "secure" tokens get routed to the right decoder class.
  DefaultSecurityTokenCodec securityTokenCodec = new DefaultSecurityTokenCodec(new FakeContainerConfig("secure"));
  assertTrue(securityTokenCodec.getCodec() instanceof BlobCrypterSecurityTokenCodec);
 }
}
origin: apache/shindig

@Test
public void testInvalidDecoder() throws Exception {
 try {
  new DefaultSecurityTokenCodec(new FakeContainerConfig("garbage"));
  fail("Should have thrown");
 } catch (RuntimeException e) {
  assertTrue("exception should contain garbage: " + e, e.getMessage().contains("garbage"));
 }
}
origin: com.lmco.shindig/shindig-common

@Test
public void testInvalidDecoder() throws Exception {
 try {
  new DefaultSecurityTokenCodec(new FakeContainerConfig("garbage"));
  fail("Should have thrown");
 } catch (RuntimeException e) {
  assertTrue("exception should contain garbage: " + e, e.getMessage().contains("garbage"));
 }
}
origin: org.gatein.shindig/shindig-common

@Test
public void testNullDecoder() throws Exception {
 try {
  new DefaultSecurityTokenCodec(new FakeContainerConfig(null));
  fail("Should have thrown");
 } catch (RuntimeException e) {
  assertTrue("exception should contain null: " + e, e.getMessage().contains("null"));
 }
}
origin: org.apache.shindig/shindig-common

 @Test
 public void testRealDecoder() throws Exception {
  // Just verifies that "secure" tokens get routed to the right decoder class.
  DefaultSecurityTokenCodec securityTokenCodec = new DefaultSecurityTokenCodec(new FakeContainerConfig("secure"));
  assertTrue(securityTokenCodec.getCodec() instanceof BlobCrypterSecurityTokenCodec);
 }
}
origin: com.lmco.shindig/shindig-common

 @Test
 public void testRealDecoder() throws Exception {
  // Just verifies that "secure" tokens get routed to the right decoder class.
  try {
   new DefaultSecurityTokenCodec(new FakeContainerConfig("secure"));
   fail("Should have thrown");
  } catch (RuntimeException e) {
   assertTrue("root cause should have been FileNotFoundException: " + e,
     e.getMessage().contains("FileNotFoundException: container key file: somecontainer"));
  }
 }
}
origin: com.lmco.shindig/shindig-common

@Test
public void testNullDecoder() throws Exception {
 try {
  new DefaultSecurityTokenCodec(new FakeContainerConfig(null));
  fail("Should have thrown");
 } catch (RuntimeException e) {
  assertTrue("exception should contain null: " + e, e.getMessage().contains("null"));
 }
}
origin: org.wso2.org.apache.shindig/shindig-common

 @Test
 public void testRealDecoder() throws Exception {
  // Just verifies that "secure" tokens get routed to the right decoder class.
  DefaultSecurityTokenCodec securityTokenCodec = new DefaultSecurityTokenCodec(new FakeContainerConfig("secure"));
  assertTrue(securityTokenCodec.getCodec() instanceof BlobCrypterSecurityTokenCodec);
 }
}
origin: org.apache.shindig/shindig-common

@Test
public void testNullDecoder() throws Exception {
 try {
  new DefaultSecurityTokenCodec(new FakeContainerConfig(null));
  fail("Should have thrown");
 } catch (RuntimeException e) {
  assertTrue("exception should contain null: " + e, e.getMessage().contains("null"));
 }
}
origin: apache/shindig

@Test
public void testNullDecoder() throws Exception {
 try {
  new DefaultSecurityTokenCodec(new FakeContainerConfig(null));
  fail("Should have thrown");
 } catch (RuntimeException e) {
  assertTrue("exception should contain null: " + e, e.getMessage().contains("null"));
 }
}
origin: org.wso2.org.apache.shindig/shindig-common

@Test
public void testNullDecoder() throws Exception {
 try {
  new DefaultSecurityTokenCodec(new FakeContainerConfig(null));
  fail("Should have thrown");
 } catch (RuntimeException e) {
  assertTrue("exception should contain null: " + e, e.getMessage().contains("null"));
 }
}
origin: org.wso2.org.apache.shindig/shindig-common

@Test
public void testInvalidDecoder() throws Exception {
 try {
  new DefaultSecurityTokenCodec(new FakeContainerConfig("garbage"));
  fail("Should have thrown");
 } catch (RuntimeException e) {
  assertTrue("exception should contain garbage: " + e, e.getMessage().contains("garbage"));
 }
}
org.apache.shindig.authDefaultSecurityTokenCodecTest$FakeContainerConfig<init>

Popular methods of DefaultSecurityTokenCodecTest$FakeContainerConfig

    Popular in Java

    • Creating JSON documents from java classes using gson
    • notifyDataSetChanged (ArrayAdapter)
    • orElseThrow (Optional)
      Return the contained value, if present, otherwise throw an exception to be created by the provided s
    • getContentResolver (Context)
    • ConnectException (java.net)
      A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
    • SecureRandom (java.security)
      This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
    • Timestamp (java.sql)
      A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
    • Enumeration (java.util)
      A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
    • Response (javax.ws.rs.core)
      Defines the contract between a returned instance and the runtime when an application needs to provid
    • LoggerFactory (org.slf4j)
      The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
    • Top 17 PhpStorm Plugins
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Tabnine for your IDE now