Examples of FakeRequest


Examples of com.jcabi.http.request.FakeRequest

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

Examples of com.jcabi.http.request.FakeRequest

     * @throws Exception if a problem occurs.
     */
    @Test
    public void canRepresentAsJson() throws Exception {
        final RtPublicKey key = new RtPublicKey(
            new FakeRequest().withBody("{}"),
            Mockito.mock(User.class),
            1
        );
        MatcherAssert.assertThat(
            key.json(),
View Full Code Here

Examples of com.jcabi.http.request.FakeRequest

     * @throws Exception if a problem occurs.
     */
    @Test
    public void canObtainUser() throws Exception {
        final User user = Mockito.mock(User.class);
        final RtPublicKey key = new RtPublicKey(new FakeRequest(), user, 2);
        MatcherAssert.assertThat(
            key.user(),
            Matchers.sameInstance(user)
        );
    }
View Full Code Here

Examples of com.jcabi.http.request.FakeRequest

     */
    @Test
    public void canObtainNumber() throws Exception {
        final int number = 39;
        final RtPublicKey key = new RtPublicKey(
            new FakeRequest(),
            Mockito.mock(User.class),
            number
        );
        MatcherAssert.assertThat(
            key.number(),
View Full Code Here

Examples of com.jcabi.http.request.FakeRequest

     */
    @Test
    public void fetchesEmails() throws Exception {
        final String email = "test@email.com";
        final UserEmails emails = new RtUserEmails(
            new FakeRequest().withBody(
                Json.createArrayBuilder()
                    .add(Json.createObjectBuilder().add("email", email))
                    .build().toString()
            )
        );
View Full Code Here

Examples of com.jcabi.http.request.FakeRequest

     * @throws Exception If some problem inside
     */
    @Test
    public void removesEmails() throws Exception {
        final UserEmails emails = new RtUserEmails(
            new FakeRequest().withStatus(HttpURLConnection.HTTP_NO_CONTENT)
        );
        emails.remove(Collections.singletonList("test2@email.com"));
    }
View Full Code Here

Examples of com.jcabi.http.request.FakeRequest

     */
    @Test
    public void returnIterator() {
        final String sha = "6dcb09b5b57875f334f61aebed695e2e4193db51";
        final RepoCommits commits = new RtRepoCommits(
            new FakeRequest().withBody(
                Json.createArrayBuilder().add(
                    // @checkstyle MultipleStringLiterals (1 line)
                    Json.createObjectBuilder().add("sha", sha)
                ).build().toString()
            ),
View Full Code Here

Examples of com.jcabi.http.request.FakeRequest

     */
    @Test
    public void getCommit() {
        final String sha = "6dcb09b5b57875f334f61aebed695e2e4193db52";
        final RepoCommits commits = new RtRepoCommits(
            new FakeRequest().withBody(
                Json.createObjectBuilder()
                    .add("sha", sha)
                    .build()
                    .toString()
            ),
View Full Code Here

Examples of com.jcabi.http.request.FakeRequest

     * RtRepoCommits can compare two commits.
     */
    @Test
    public void comparesCommits() {
        final RepoCommits commits = new RtRepoCommits(
            new FakeRequest().withBody(
                Json.createObjectBuilder()
                    .add("base_commit", Json.createObjectBuilder())
                    .add("commits", Json.createArrayBuilder())
                    .add("files", Json.createArrayBuilder())
                    .build().toString()
View Full Code Here

Examples of com.jcabi.http.request.FakeRequest

     * @throws Exception If some problem inside
     */
    @Test
    public void comparesCommitsDiffFormat() throws Exception {
        final RepoCommits commits = new RtRepoCommits(
            new FakeRequest().withBody("diff --git"),
            RtRepoCommitsTest.repo()
        );
        MatcherAssert.assertThat(
            commits.diff(
                "6dcb09b5b57875f334f61aebed695e2e4193db55",
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.