src/test/java/com/jcabi/github/RtReferenceTest.java
/**
     * RtReference should be able to execute patch.
     * @throws Exception - If something goes wrong.
     */
RtReference should be able to execute patch.
@throws Exception - If something goes wrong.
RtReference should be able to execute patch . @throws Exception - If something goes wrong .
@Test
    public void patchesContent() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(
                HttpURLConnection.HTTP_OK,
                "{\"ref\":\"refs/heads/featureA\"}"
            )
        ).start();
        final Reference reference = new RtReference(
            new ApacheRequest(container.home()), repo(), "refs/heads/featureA"
        );
        try {
            reference.patch(
                Json.createObjectBuilder().add("sha", "abcdef12345")
                .add("force", "false").build()
            );
            MatcherAssert.assertThat(
                container.take().method(),
                Matchers.equalTo(Request.PATCH)
            );
        } finally {
            container.stop();
        }
    }
@ Test public void patchesContent ( ) throws Exception { final MkContainer container = new MkGrizzlyContainer ( ) . next ( new MkAnswer . Simple ( HttpURLConnection . HTTP_OK , "{\"ref\":\"refs/heads/featureA\"}" ) ) . start ( ) ; final Reference reference = new RtReference ( new ApacheRequest ( container . home ( ) ) , repo ( ) , "refs/heads/featureA" ) ; try { reference . patch ( Json . createObjectBuilder ( ) . add ( "sha" , "abcdef12345" ) . add ( "force" , "false" ) . build ( ) ) ; MatcherAssert . assertThat ( container . take ( ) . method ( ) , Matchers . equalTo ( Request . PATCH ) ) ; } finally { container . stop ( ) ; } }
RtReference should be able to execute patch.
RtReference should be able to execute patch .