package us.codecraft.webmagic.selector;

import org.junit.Test;
import us.codecraft.webmagic.Page;

import static org.assertj.core.api.Assertions.assertThat;

/**
 * @author code4crafter@gmai.com
 * @since 0.5.0
 */
public class JsonTest {

    private String text = "callback({\"name\":\"json\"})";

    @Test
    public void testRemovePadding() throws Exception {
        String name = new Json(text).removePadding("callback").jsonPath("$.name").get();
        assertThat(name).isEqualTo("json");
        Page page = null;

        page.getJson().jsonPath("$.name").get();
        page.getJson().removePadding("callback").jsonPath("$.name").get();
    }
}

@@ -60,43 +60,8 @@
 est;
-%0Aimport us.codecraft.webmagic.Page;
 %0A%0Aim
@@ -461,159 +461,8 @@
 %22);%0A
-        Page page = null;%0A%0A        page.getJson().jsonPath(%22$.name%22).get();%0A        page.getJson().removePadding(%22callback%22).jsonPath(%22$.name%22).get();%0A
     

fix tests