Examples of FakeRequest


Examples of com.jcabi.http.request.FakeRequest

     */
    @Test
    public void describeAsJson() throws Exception {
        final Repo repo = new RtRepo(
            Mockito.mock(Github.class),
            new FakeRequest().withBody(
                Json.createObjectBuilder()
                    .add("full_name", "octocat/Hello-World")
                    .add("fork", true)
                    .build()
                    .toString()
View Full Code Here

Examples of com.jcabi.http.request.FakeRequest

     */
    @Test
    public void fetchCommits() {
        final Repo repo = new RtRepo(
            Mockito.mock(Github.class),
            new FakeRequest(),
            new Coordinates.Simple("testuser", "testrepo")
        );
        MatcherAssert.assertThat(repo.commits(), Matchers.notNullValue());
    }
View Full Code Here

Examples of com.jcabi.http.request.FakeRequest

     * RtRepo can fetch Git.
     */
    public void fetchesGit() {
        final Repo repo = new RtRepo(
            Mockito.mock(Github.class),
            new FakeRequest(),
            new Coordinates.Simple("gituser", "gitrepo")
        );
        MatcherAssert.assertThat(repo.git(), Matchers.notNullValue());
    }
View Full Code Here

Examples of com.jcabi.http.request.FakeRequest

     */
    @Test
    public void fetchStars() {
        final Repo repo = new RtRepo(
            Mockito.mock(Github.class),
            new FakeRequest(),
            new Coordinates.Simple("testuser2", "testrepo2")
        );
        MatcherAssert.assertThat(repo.stars(), Matchers.notNullValue());
    }
View Full Code Here

Examples of com.jcabi.http.request.FakeRequest

     */
    @Test
    public void fetchNotifications() {
        final Repo repo = new RtRepo(
            Mockito.mock(Github.class),
            new FakeRequest(),
            new Coordinates.Simple("testnuser", "testnrepos")
        );
        MatcherAssert.assertThat(repo.notifications(), Matchers.notNullValue());
    }
View Full Code Here

Examples of com.jcabi.http.request.FakeRequest

     * @throws Exception if a problem occurs.
     */
    @Test
    public void retrievesForks() throws Exception {
        final RtForks forks = new RtForks(
            new FakeRequest()
                .withBody("[]"), this.repo()
        );
        MatcherAssert.assertThat(
            forks.iterate("newest"),
            Matchers.<Fork>iterableWithSize(0)
View Full Code Here

Examples of com.jcabi.http.request.FakeRequest

     * @throws Exception if a problem occurs.
     */
    @Test
    public void canRetrieveOwnRepo() throws Exception {
        final Repo repo = this.repo();
        final RtEvent event = new RtEvent(new FakeRequest(), repo, 1);
        MatcherAssert.assertThat(
            event.repo(),
            Matchers.sameInstance(repo)
        );
    }
View Full Code Here

Examples of com.jcabi.http.request.FakeRequest

     * @throws Exception if a problem occurs.
     */
    @Test
    public void canRetrieveOwnNumber() throws Exception {
        final Repo repo = this.repo();
        final RtEvent event = new RtEvent(new FakeRequest(), repo, 2);
        MatcherAssert.assertThat(
            event.number(),
            Matchers.equalTo(2)
        );
    }
View Full Code Here

Examples of com.jcabi.http.request.FakeRequest

     *
     * @throws Exception when a problem occurs.
     */
    @Test
    public void canCompareInstances() throws Exception {
        final RtEvent less = new RtEvent(new FakeRequest(), this.repo(), 1);
        final RtEvent greater = new RtEvent(new FakeRequest(), this.repo(), 2);
        MatcherAssert.assertThat(
            less.compareTo(greater), Matchers.lessThan(0)
        );
        MatcherAssert.assertThat(
            greater.compareTo(less), Matchers.greaterThan(0)
View Full Code Here

Examples of com.jcabi.http.request.FakeRequest

     *
     * @throws Exception when a problem occurs.
     */
    @Test
    public void canCompareInstances() throws Exception {
        final RtPull less = new RtPull(new FakeRequest(), this.repo(), 1);
        final RtPull greater = new RtPull(new FakeRequest(), this.repo(), 2);
        MatcherAssert.assertThat(
            less.compareTo(greater), Matchers.lessThan(0)
        );
        MatcherAssert.assertThat(
            greater.compareTo(less), Matchers.greaterThan(0)
View Full Code Here
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.