Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
f87072f3
Commit
f87072f3
authored
Dec 06, 2017
by
Sarath Subramanian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2302: Fix test failures in AtlasClientTest
parent
69330a5d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
AtlasClientTest.java
...nt-v1/src/test/java/org/apache/atlas/AtlasClientTest.java
+5
-3
AtlasBaseClient.java
...ommon/src/main/java/org/apache/atlas/AtlasBaseClient.java
+4
-1
No files found.
client/client-v1/src/test/java/org/apache/atlas/AtlasClientTest.java
View file @
f87072f3
...
...
@@ -17,15 +17,13 @@
package
org
.
apache
.
atlas
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
com.fasterxml.jackson.databind.node.ObjectNode
;
import
com.sun.jersey.api.client.Client
;
import
com.sun.jersey.api.client.ClientHandlerException
;
import
com.sun.jersey.api.client.ClientResponse
;
import
com.sun.jersey.api.client.WebResource
;
import
org.apache.atlas.model.legacy.EntityResult
;
import
org.apache.atlas.v1.model.instance.Referenceable
;
import
org.apache.atlas.type.AtlasType
;
import
org.apache.atlas.v1.model.instance.Referenceable
;
import
org.apache.commons.configuration.Configuration
;
import
org.apache.hadoop.security.UserGroupInformation
;
import
org.mockito.Matchers
;
...
...
@@ -97,6 +95,10 @@ public class AtlasClientTest {
ClientResponse
response
=
mock
(
ClientResponse
.
class
);
when
(
response
.
getStatus
()).
thenReturn
(
Response
.
Status
.
CREATED
.
getStatusCode
());
String
jsonResponse
=
AtlasType
.
toV1Json
(
new
EntityResult
(
Arrays
.
asList
(
"id"
),
null
,
null
));
when
(
response
.
getEntity
(
String
.
class
)).
thenReturn
(
jsonResponse
.
toString
());
when
(
response
.
getLength
()).
thenReturn
(
jsonResponse
.
length
());
String
entityJson
=
AtlasType
.
toV1Json
(
new
Referenceable
(
"type"
));
when
(
builder
.
method
(
anyString
(),
Matchers
.<
Class
>
any
(),
anyString
())).
thenReturn
(
response
);
...
...
client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java
View file @
f87072f3
...
...
@@ -72,6 +72,7 @@ public abstract class AtlasBaseClient {
public
static
final
String
QUERY
=
"query"
;
public
static
final
String
LIMIT
=
"limit"
;
public
static
final
String
OFFSET
=
"offset"
;
public
static
final
String
STATUS
=
"Status"
;
public
static
final
API
API_STATUS
=
new
API
(
BASE_URI
+
ADMIN_STATUS
,
HttpMethod
.
GET
,
Response
.
Status
.
OK
);;
public
static
final
API
API_VERSION
=
new
API
(
BASE_URI
+
ADMIN_VERSION
,
HttpMethod
.
GET
,
Response
.
Status
.
OK
);;
...
...
@@ -189,7 +190,9 @@ public abstract class AtlasBaseClient {
WebResource
resource
=
getResource
(
service
,
API_STATUS
.
getNormalizedPath
());
ObjectNode
response
=
callAPIWithResource
(
API_STATUS
,
resource
,
null
,
ObjectNode
.
class
);
result
=
response
.
get
(
"Status"
).
asText
();
if
(
response
.
has
(
STATUS
))
{
result
=
response
.
get
(
STATUS
).
asText
();
}
return
result
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment