Package org.opengraphtests

Source Code of org.opengraphtests.OpenGraphTest

package org.opengraphtests;

import org.junit.Test;
import org.opengraph.OpenGraph;

import static org.junit.Assert.*;

public class OpenGraphTest {
  @Test
  public void shouldHandleMissingContentType() throws java.lang.Exception {
    OpenGraph site = new OpenGraph("http://www.bbc.com/future/story/20140428-the-myth-of-tech-revolutions", true);
    assertEquals("Why it’s time to ditch the word ‘revolution’ in tech", site.getContent("title"));
    assertEquals("624", site.getContent("image:width"));
  }

  @Test
  public void shouldNoOGMarkup() throws java.lang.Exception {
    OpenGraph site = new OpenGraph("http://clang.llvm.org/docs/UsersManual.html", true);
    assertNull(site.getContent("title"));
  }
}
TOP

Related Classes of org.opengraphtests.OpenGraphTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.