Package br.com.caelum.tubaina.gists

Examples of br.com.caelum.tubaina.gists.GistRequest


public class GistTagTest extends AbstractTagTest {

  @Test
  public void gistedCodeIsRetrievedAndUsed() throws Exception {
    GistResultRetriever retriever = new GistResultRetriever(new GistConnector(new JsonToGistResultConverter(),
        new GistRequest()));

    String options = "417835";
    @SuppressWarnings("unused")
    // code to be retrieved, we can only assert parts of it
    String gistedCode = "javascript:(function() {window.frames[3][0].document.getElementById('frameplugin').style.display='none'})()";
View Full Code Here


    long gistId = 417835;

    String json = new Scanner(JsonToGistResultConverter.class.getResourceAsStream("/gist.json"))
        .useDelimiter("\\Z").next();

    GistRequest mockedGistRequest = mock(GistRequest.class);
    when(mockedGistRequest.get(gistId)).thenReturn(json);

    GistConnector connector = new GistConnector(new JsonToGistResultConverter(), mockedGistRequest);

    GistResultRetriever retriever = new GistResultRetriever(connector);
View Full Code Here

TOP

Related Classes of br.com.caelum.tubaina.gists.GistRequest

Copyright © 2018 www.massapicom. 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.