File tree 16 files changed +101
-74
lines changed
16 files changed +101
-74
lines changed Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change 1
1
# 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 )
2
3
GitHubAPI wrapper for scala
3
4
4
5
## Dependencies
Original file line number Diff line number Diff line change
1
+ package codecheck .github
2
+ package operations
3
+
1
4
import org .scalatest .FunSpec
2
5
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
7
6
import scala .concurrent .Await
8
7
import scala .concurrent .ExecutionContext .Implicits .global
9
- import codecheck .github .models .UserInput
10
8
11
9
class BranchOpSpec extends FunSpec
12
- with Constants
10
+ with api. Constants
13
11
with BeforeAndAfterAll
14
12
{
15
13
describe(" getBranch" ) {
Original file line number Diff line number Diff line change
1
+ package codecheck .github
2
+ package operations
3
+
4
+ import exceptions ._
5
+
1
6
import org .scalatest .path .FunSpec
2
7
import scala .concurrent .Await
3
- import codecheck .github .models .Collaborator
4
- import codecheck .github .exceptions .GitHubAPIException
5
- import codecheck .github .exceptions .NotFoundException
6
8
7
- class CollaboratorOpSpec extends FunSpec with Constants {
9
+ class CollaboratorOpSpec extends FunSpec with api.Constants
10
+ {
8
11
9
12
describe(" addCollaborator" ){
10
13
it(" should add Collaborator User to user Repo" ){
Original file line number Diff line number Diff line change
1
+ package codecheck .github
2
+ package api
3
+
4
+ import transport .asynchttp20 .AsyncHttp20Transport
5
+
1
6
import org .asynchttpclient .DefaultAsyncHttpClient
2
- import codecheck .github .api .GitHubAPI
3
- import codecheck .github .api .PrintlnHandler
4
- import codecheck .github .transport .asynchttp20 .AsyncHttp20Transport
5
7
import scala .concurrent .duration ._
6
8
import scala .util .Random ._
7
9
import org .scalatest .time .Span ._
Original file line number Diff line number Diff line change
1
+ package codecheck .github
2
+ package operations
3
+
4
+ import models ._
5
+
1
6
import org .scalatest .FunSpec
2
7
import org .scalatest .BeforeAndAfterAll
3
8
import scala .concurrent .Await
4
9
import org .joda .time .DateTime
5
10
import org .joda .time .DateTimeZone
6
11
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 {
22
13
23
14
val number = 1
24
15
var nUser : Long = 0
Original file line number Diff line number Diff line change
1
+ package codecheck .github
2
+ package operations
3
+
4
+ import exceptions ._
5
+ import models ._
6
+
1
7
import org .scalatest .FunSpec
2
8
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
7
9
8
- class LabelOpSpec extends FunSpec with Constants {
10
+ class LabelOpSpec extends FunSpec with api. Constants {
9
11
10
12
val number = 1
11
13
val gName = generateRandomWord
Original file line number Diff line number Diff line change
1
+ package codecheck .github
2
+ package operations
3
+
4
+ import exceptions ._
5
+ import models ._
6
+
1
7
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
10
8
import scala .concurrent .Await
11
9
import scala .concurrent .ExecutionContext .Implicits .global
12
10
import org .joda .time .DateTime
13
11
14
12
class MilestoneOpSpec extends FunSpec
15
- with Constants
13
+ with api. Constants
16
14
{
17
15
18
16
private def removeAll = {
Original file line number Diff line number Diff line change
1
+ package codecheck .github
2
+ package operations
3
+
1
4
import org .scalatest .FunSpec
2
5
import org .scalatest .BeforeAndAfter
3
6
import scala .concurrent .Await
@@ -6,7 +9,7 @@ import org.joda.time.DateTimeZone
6
9
7
10
import codecheck .github .models .OrganizationInput
8
11
9
- class OrganizationOpSpec extends FunSpec with Constants with BeforeAndAfter {
12
+ class OrganizationOpSpec extends FunSpec with api. Constants with BeforeAndAfter {
10
13
11
14
describe(" listOwnOrganizations" ) {
12
15
it(" should return result." ) {
@@ -21,10 +24,11 @@ class OrganizationOpSpec extends FunSpec with Constants with BeforeAndAfter {
21
24
assert(result.length >= 1 )
22
25
}
23
26
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
+ // }
28
32
}
29
33
30
34
describe(" getOrganization" ) {
Original file line number Diff line number Diff line change
1
+ package codecheck .github
2
+ package operations
3
+
4
+ import models ._
5
+
1
6
import org .scalatest .FunSpec
2
7
import scala .concurrent .Await
3
-
4
- import codecheck .github .models .IssueState
5
- import codecheck .github .models .PullRequestInput
6
8
import java .util .Date
7
9
8
- class PullRequestOpSpec extends FunSpec with Constants {
10
+ class PullRequestOpSpec extends FunSpec with api. Constants {
9
11
10
12
describe(" listPullRequests" ) {
11
13
it(" with valid repo should succeed" ) {
Original file line number Diff line number Diff line change
1
+ package codecheck .github
2
+ package api
3
+
1
4
import org .scalatest .FunSpec
2
5
3
- class RepositoryAPISpec extends FunSpec with Constants {
6
+ class RepositoryAPISpec extends FunSpec with api. Constants {
4
7
5
8
val gDummy = generateRandomString
6
9
val gRepo = generateRandomString
Original file line number Diff line number Diff line change
1
+ package codecheck .github
2
+ package operations
3
+
1
4
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
7
5
import scala .concurrent .Await
8
6
import scala .concurrent .ExecutionContext .Implicits .global
9
7
10
- class RepositoryOpSpec extends FunSpec with Constants
8
+ class RepositoryOpSpec extends FunSpec with api. Constants
11
9
{
12
10
13
11
describe(" listOwnRepositories" ) {
@@ -89,7 +87,7 @@ class RepositoryOpSpec extends FunSpec with Constants
89
87
val repo = Await.result(api.createUserRepository(input), TIMEOUT)
90
88
fail
91
89
} catch {
92
- case e: GitHubAPIException =>
90
+ case e: ApiException =>
93
91
assert(e.error.errors.head.field == "name")
94
92
case e: Throwable =>
95
93
fail
Original file line number Diff line number Diff line change
1
+ package codecheck .github
2
+ package operations
3
+
4
+ import exceptions ._
5
+ import models ._
6
+
1
7
import org .scalatest .FunSpec
2
8
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
7
9
import scala .concurrent .Await
8
10
import scala .concurrent .ExecutionContext .Implicits .global
9
- import codecheck .github .models .UserInput
10
11
11
12
class UserOpSpec extends FunSpec
12
- with Constants
13
+ with api. Constants
13
14
with BeforeAndAfterAll
14
15
{
15
16
val origin = Await .result(api.getAuthenticatedUser, TIMEOUT )
Original file line number Diff line number Diff line change
1
+ package codecheck .github
2
+ package operations
3
+
4
+ import models ._
1
5
2
6
import org .scalatest .FunSpec
3
7
import org .scalatest .BeforeAndAfter
4
8
import scala .concurrent .Await
5
9
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 {
13
11
14
12
val targetURL = " http://github-hook.herokuapp.com/hook"
15
13
var nID : Long = 0 ;
Original file line number Diff line number Diff line change 1
- package codecheck .github .events
1
+ package codecheck .github
2
+ package events
2
3
3
4
import org .json4s .jackson .JsonMethods
4
5
Original file line number Diff line number Diff line change 1
- package codecheck .github .events
1
+ package codecheck .github
2
+ package events
2
3
3
4
import org .json4s .jackson .JsonMethods
4
5
You can’t perform that action at this time.
0 commit comments