Skip to content

Commit 6255527

Browse files
committed
Merge branch 'master' into separated-issue-state
2 parents ec91c1f + ee50170 commit 6255527

16 files changed

+101
-74
lines changed

Diff for: .travis.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
language: scala
2+
3+
scala:
4+
- 2.10.6
5+
- 2.11.7
6+
- 2.12.1
7+
8+
script:
9+
- sbt ++$TRAVIS_SCALA_VERSION test:compile
10+
11+
# Container-based build environment with faster boot times
12+
sudo: false
13+
14+
jdk:
15+
- oraclejdk8
16+
17+
before_cache:
18+
- find $HOME/.sbt -name "*.lock" | xargs rm
19+
- find $HOME/.ivy2/cache -name "ivydata-*.properties" | xargs rm
20+
cache:
21+
directories:
22+
- $HOME/.ivy2/cache
23+
- $HOME/.sbt/boot
24+
- $HOME/.sbt/launchers

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# GitHubAPI for scala
2+
[![Build Status](https://travis-ci.org/code-check/github-api-scala.svg?branch=master)](https://travis-ci.org/code-check/github-api-scala)
23
GitHubAPI wrapper for scala
34

45
## Dependencies

Diff for: src/test/scala/BranchOpSpec.scala

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1+
package codecheck.github
2+
package operations
3+
14
import org.scalatest.FunSpec
25
import org.scalatest.BeforeAndAfterAll
3-
import codecheck.github.exceptions.NotFoundException
4-
import codecheck.github.models._
5-
import codecheck.github.exceptions.GitHubAPIException
6-
import codecheck.github.exceptions.NotFoundException
76
import scala.concurrent.Await
87
import scala.concurrent.ExecutionContext.Implicits.global
9-
import codecheck.github.models.UserInput
108

119
class BranchOpSpec extends FunSpec
12-
with Constants
10+
with api.Constants
1311
with BeforeAndAfterAll
1412
{
1513
describe("getBranch") {

Diff for: src/test/scala/CollaboratorOpSpec.scala

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
package codecheck.github
2+
package operations
3+
4+
import exceptions._
5+
16
import org.scalatest.path.FunSpec
27
import scala.concurrent.Await
3-
import codecheck.github.models.Collaborator
4-
import codecheck.github.exceptions.GitHubAPIException
5-
import codecheck.github.exceptions.NotFoundException
68

7-
class CollaboratorOpSpec extends FunSpec with Constants {
9+
class CollaboratorOpSpec extends FunSpec with api.Constants
10+
{
811

912
describe("addCollaborator"){
1013
it("should add Collaborator User to user Repo"){

Diff for: src/test/scala/Constants.scala

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
package codecheck.github
2+
package api
3+
4+
import transport.asynchttp20.AsyncHttp20Transport
5+
16
import org.asynchttpclient.DefaultAsyncHttpClient
2-
import codecheck.github.api.GitHubAPI
3-
import codecheck.github.api.PrintlnHandler
4-
import codecheck.github.transport.asynchttp20.AsyncHttp20Transport
57
import scala.concurrent.duration._
68
import scala.util.Random._
79
import org.scalatest.time.Span._

Diff for: src/test/scala/IssueOpSpec.scala

+6-15
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,15 @@
1+
package codecheck.github
2+
package operations
3+
4+
import models._
5+
16
import org.scalatest.FunSpec
27
import org.scalatest.BeforeAndAfterAll
38
import scala.concurrent.Await
49
import org.joda.time.DateTime
510
import org.joda.time.DateTimeZone
611

7-
import codecheck.github.models.IssueListOption
8-
import codecheck.github.models.IssueFilter
9-
import codecheck.github.models.IssueListOption4Repository
10-
import codecheck.github.models.IssueState
11-
import codecheck.github.models.IssueStateFilter
12-
import codecheck.github.models.Issue
13-
import codecheck.github.models.IssueInput
14-
import codecheck.github.models.MilestoneSearchOption
15-
16-
import codecheck.github.models.MilestoneInput
17-
import codecheck.github.models.MilestoneListOption
18-
import codecheck.github.models.MilestoneState
19-
import codecheck.github.models.Milestone
20-
21-
class IssueOpSpec extends FunSpec with Constants with BeforeAndAfterAll {
12+
class IssueOpSpec extends FunSpec with api.Constants with BeforeAndAfterAll {
2213

2314
val number = 1
2415
var nUser: Long = 0

Diff for: src/test/scala/LabelOpSpec.scala

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
package codecheck.github
2+
package operations
3+
4+
import exceptions._
5+
import models._
6+
17
import org.scalatest.FunSpec
28
import scala.concurrent.Await
3-
import codecheck.github.models.Label
4-
import codecheck.github.models.LabelInput
5-
import codecheck.github.exceptions.GitHubAPIException
6-
import codecheck.github.exceptions.NotFoundException
79

8-
class LabelOpSpec extends FunSpec with Constants {
10+
class LabelOpSpec extends FunSpec with api.Constants {
911

1012
val number = 1
1113
val gName = generateRandomWord

Diff for: src/test/scala/MilestoneOpSpec.scala

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1+
package codecheck.github
2+
package operations
3+
4+
import exceptions._
5+
import models._
6+
17
import org.scalatest.path.FunSpec
2-
import codecheck.github.exceptions.NotFoundException
3-
import codecheck.github.models.Milestone
4-
import codecheck.github.models.MilestoneInput
5-
import codecheck.github.models.MilestoneListOption
6-
import codecheck.github.models.MilestoneState
7-
import codecheck.github.models.SortDirection
8-
import codecheck.github.exceptions.GitHubAPIException
9-
import codecheck.github.exceptions.NotFoundException
108
import scala.concurrent.Await
119
import scala.concurrent.ExecutionContext.Implicits.global
1210
import org.joda.time.DateTime
1311

1412
class MilestoneOpSpec extends FunSpec
15-
with Constants
13+
with api.Constants
1614
{
1715

1816
private def removeAll = {

Diff for: src/test/scala/OraganizationOpSpec.scala

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
package codecheck.github
2+
package operations
3+
14
import org.scalatest.FunSpec
25
import org.scalatest.BeforeAndAfter
36
import scala.concurrent.Await
@@ -6,7 +9,7 @@ import org.joda.time.DateTimeZone
69

710
import codecheck.github.models.OrganizationInput
811

9-
class OrganizationOpSpec extends FunSpec with Constants with BeforeAndAfter {
12+
class OrganizationOpSpec extends FunSpec with api.Constants with BeforeAndAfter {
1013

1114
describe("listOwnOrganizations") {
1215
it("should return result.") {
@@ -21,10 +24,11 @@ class OrganizationOpSpec extends FunSpec with Constants with BeforeAndAfter {
2124
assert(result.length >= 1)
2225
}
2326

24-
it("should return multiple organizations if user belongs in more than one.") {
25-
val result = Await.result(api.listUserOrganizations(otherUser), TIMEOUT)
26-
assert(result.length > 1)
27-
}
27+
// it("should return multiple organizations if user belongs in more than one.") {
28+
// val result = Await.result(api.listUserOrganizations(otherUser), TIMEOUT)
29+
// println(result)
30+
// assert(result.length > 1)
31+
// }
2832
}
2933

3034
describe("getOrganization") {

Diff for: src/test/scala/PullRequestOpSpec.scala

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
package codecheck.github
2+
package operations
3+
4+
import models._
5+
16
import org.scalatest.FunSpec
27
import scala.concurrent.Await
3-
4-
import codecheck.github.models.IssueState
5-
import codecheck.github.models.PullRequestInput
68
import java.util.Date
79

8-
class PullRequestOpSpec extends FunSpec with Constants {
10+
class PullRequestOpSpec extends FunSpec with api.Constants {
911

1012
describe("listPullRequests") {
1113
it("with valid repo should succeed") {

Diff for: src/test/scala/RepositoryAPISpec.scala

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
package codecheck.github
2+
package api
3+
14
import org.scalatest.FunSpec
25

3-
class RepositoryAPISpec extends FunSpec with Constants {
6+
class RepositoryAPISpec extends FunSpec with api.Constants {
47

58
val gDummy = generateRandomString
69
val gRepo = generateRandomString

Diff for: src/test/scala/RepositoryOpSpec.scala

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1+
package codecheck.github
2+
package operations
3+
14
import org.scalatest.path.FunSpec
2-
import codecheck.github.exceptions.NotFoundException
3-
import codecheck.github.models.Repository
4-
import codecheck.github.models.RepositoryInput
5-
import codecheck.github.exceptions.GitHubAPIException
6-
import codecheck.github.exceptions.NotFoundException
75
import scala.concurrent.Await
86
import scala.concurrent.ExecutionContext.Implicits.global
97

10-
class RepositoryOpSpec extends FunSpec with Constants
8+
class RepositoryOpSpec extends FunSpec with api.Constants
119
{
1210

1311
describe("listOwnRepositories") {
@@ -89,7 +87,7 @@ class RepositoryOpSpec extends FunSpec with Constants
8987
val repo = Await.result(api.createUserRepository(input), TIMEOUT)
9088
fail
9189
} catch {
92-
case e: GitHubAPIException =>
90+
case e: ApiException =>
9391
assert(e.error.errors.head.field == "name")
9492
case e: Throwable =>
9593
fail

Diff for: src/test/scala/UserOpSpec.scala

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1+
package codecheck.github
2+
package operations
3+
4+
import exceptions._
5+
import models._
6+
17
import org.scalatest.FunSpec
28
import org.scalatest.BeforeAndAfterAll
3-
import codecheck.github.exceptions.NotFoundException
4-
import codecheck.github.models.Repository
5-
import codecheck.github.exceptions.GitHubAPIException
6-
import codecheck.github.exceptions.NotFoundException
79
import scala.concurrent.Await
810
import scala.concurrent.ExecutionContext.Implicits.global
9-
import codecheck.github.models.UserInput
1011

1112
class UserOpSpec extends FunSpec
12-
with Constants
13+
with api.Constants
1314
with BeforeAndAfterAll
1415
{
1516
val origin = Await.result(api.getAuthenticatedUser, TIMEOUT)

Diff for: src/test/scala/WebhookOpSpec.scala

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1+
package codecheck.github
2+
package operations
3+
4+
import models._
15

26
import org.scalatest.FunSpec
37
import org.scalatest.BeforeAndAfter
48
import scala.concurrent.Await
59

6-
import codecheck.github.models.Webhook
7-
import codecheck.github.models.WebhookConfig
8-
import codecheck.github.models.WebhookCreateInput
9-
import codecheck.github.models.WebhookUpdateInput
10-
11-
12-
class WebhookOpSpec extends FunSpec with Constants with BeforeAndAfter {
10+
class WebhookOpSpec extends FunSpec with api.Constants with BeforeAndAfter {
1311

1412
val targetURL = "http://github-hook.herokuapp.com/hook"
1513
var nID: Long = 0;

Diff for: src/test/scala/events/IssueEventJson.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
package codecheck.github.events
1+
package codecheck.github
2+
package events
23

34
import org.json4s.jackson.JsonMethods
45

Diff for: src/test/scala/events/PullRequestEventJson.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
package codecheck.github.events
1+
package codecheck.github
2+
package events
23

34
import org.json4s.jackson.JsonMethods
45

0 commit comments

Comments
 (0)