Package com.jcabi.http.mock

Examples of com.jcabi.http.mock.MkGrizzlyContainer


     * RtAssignees can check if user is NOT assignee for this repo.
     * @throws Exception Exception If some problem inside
     */
    @Test
    public void checkUserIsNotAssigneeForRepo() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(
                HttpURLConnection.HTTP_NOT_FOUND,
                Json.createArrayBuilder()
                    .add(RtAssigneesTest.json("octocat3"))
                    .add(RtAssigneesTest.json("dummy"))
View Full Code Here


     *
     * @throws Exception when an error occurs
     */
    @Test
    public final void createsCommit() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(
                HttpURLConnection.HTTP_CREATED,
                "{\"sha\":\"0abcd89jcabitest\"}"
            )
        ).start();
View Full Code Here

     * @throws Exception - If something goes wrong.
     * @checkstyle IndentationCheck (20 lines)
     */
    @Test
    public void createsTag() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(
                HttpURLConnection.HTTP_CREATED,
                "{\"sha\":\"0abcd89jcabitest\",\"tag\":\"v.0.1\"}"
            )
        ).next(
View Full Code Here

     *
     * @throws Exception If a problem occurs.
     */
    @Test
    public void performsValidRequest() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(
                HttpURLConnection.HTTP_OK,
                "{\"test\":\"hook\"}"
            )
        ).start();
View Full Code Here

            "src/attributes/classes.js",
            "classes.js",
            // @checkstyle LineLength (1 line)
            "https://api.github.com/repos/user/repo/contents/src/attributes/classes.js?ref=f3b89ba0820882bd4ce4404b7e7c819e7b506de5"
        ).build();
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(RtSearchTest.search(first, second).toString())
        ).next(new MkAnswer.Simple(first.toString()))
            .next(new MkAnswer.Simple(second.toString()))
            .start();
        try {
View Full Code Here

    public void canFetchReadmeFile() throws Exception {
        final String path = "README.md";
        final JsonObject body = Json.createObjectBuilder()
            .add("path", path)
            .build();
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, body.toString())
        ).start();
        final RtContents contents = new RtContents(
            new ApacheRequest(container.home()),
            repo()
View Full Code Here

    public void canFetchReadmeFileFromSpecifiedBranch() throws Exception {
        final String path = "README.md";
        final JsonObject body = Json.createObjectBuilder()
            .add("path", path)
            .build();
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, body.toString())
        ).start();
        final RtContents contents = new RtContents(
            new ApacheRequest(container.home()),
            repo()
View Full Code Here

        final String name = "file";
        final JsonObject body = Json.createObjectBuilder()
            .add("path", path)
            .add("name", name)
            .build();
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(
                HttpURLConnection.HTTP_OK,
                Json.createObjectBuilder()
                    .add("path", path)
                    .add("name", name)
View Full Code Here

        final String name = "thefile";
        final JsonObject body = Json.createObjectBuilder()
            .add("path", path)
            .add("name", name)
            .build();
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(
                HttpURLConnection.HTTP_CREATED,
                Json.createObjectBuilder().add("content", body)
                    .build().toString()
            )
View Full Code Here

     * @throws Exception if a problem occurs.
     * @checkstyle MultipleStringLiteralsCheck (50 lines)
     */
    @Test
    public void canDeleteFilesFromRepository() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(
                HttpURLConnection.HTTP_OK,
                Json.createObjectBuilder().add(
                    "commit",
                    Json.createObjectBuilder()
View Full Code Here

TOP

Related Classes of com.jcabi.http.mock.MkGrizzlyContainer

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.