Tabnine Logo
DefaultSecurityTokenCodecTest$FakeContainerConfig
Code IndexAdd Tabnine to your IDE (free)

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

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

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: 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: 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"));
 }
}
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.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"));
 }
}
org.apache.shindig.authDefaultSecurityTokenCodecTest$FakeContainerConfig

Most used methods

  • <init>

Popular in Java

  • Reading from database using SQL prepared statement
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getSharedPreferences (Context)
  • setContentView (Activity)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • BoxLayout (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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