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
bd31c505
Commit
bd31c505
authored
Jul 18, 2019
by
Madhan Neethiraj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3067: updated EntityJerseyResourceIT.testUTF8() to aid troubleshooting failures - #3
parent
ca62d865
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
+8
-11
EntityJerseyResourceIT.java
.../apache/atlas/web/integration/EntityJerseyResourceIT.java
+8
-11
No files found.
webapp/src/test/java/org/apache/atlas/web/integration/EntityJerseyResourceIT.java
View file @
bd31c505
...
...
@@ -820,27 +820,24 @@ public class EntityJerseyResourceIT extends BaseResourceIT {
@Test
public
void
testUTF8
()
throws
Exception
{
//Type names cannot be arbitrary UTF8 characters. See org.apache.atlas.type.AtlasTypeUtil#validateType()
String
classType
=
randomString
();
String
classType
=
randomString
();
//Type names cannot be arbitrary UTF8 characters. See org.apache.atlas.type.AtlasTypeUtil#validateType()
String
attrName
=
random
();
String
attrValue
=
random
();
ClassTypeDefinition
classTypeDefinition
=
TypesUtil
.
createClassTypeDef
(
classType
,
null
,
Collections
.<
String
>
emptySet
(),
TypesUtil
.
createUniqueRequiredAttrDef
(
attrName
,
AtlasBaseTypeDef
.
ATLAS_TYPE_STRING
));
TypesDef
typesDef
=
new
TypesDef
(
Collections
.<
EnumTypeDefinition
>
emptyList
(),
Collections
.<
StructTypeDefinition
>
emptyList
(),
Collections
.<
TraitTypeDefinition
>
emptyList
(),
Collections
.
singletonList
(
classTypeDefinition
));
ClassTypeDefinition
classTypeDefinition
=
TypesUtil
.
createClassTypeDef
(
classType
,
null
,
Collections
.<
String
>
emptySet
(),
TypesUtil
.
createUniqueRequiredAttrDef
(
attrName
,
AtlasBaseTypeDef
.
ATLAS_TYPE_STRING
));
TypesDef
typesDef
=
new
TypesDef
(
Collections
.<
EnumTypeDefinition
>
emptyList
(),
Collections
.<
StructTypeDefinition
>
emptyList
(),
Collections
.<
TraitTypeDefinition
>
emptyList
(),
Collections
.
singletonList
(
classTypeDefinition
));
createType
(
typesDef
);
Referenceable
instance
=
new
Referenceable
(
classType
,
Collections
.
singletonMap
(
attrName
,
attrValue
));
Id
guid
=
createInstance
(
instanc
e
);
Referenceable
entityToCreate
=
new
Referenceable
(
classType
,
Collections
.
singletonMap
(
attrName
,
attrValue
));
Id
guid
=
createInstance
(
entityToCreat
e
);
ObjectNode
response
=
atlasClientV1
.
callAPIWithBodyAndParams
(
AtlasClient
.
API_V1
.
GET_ENTITY
,
null
,
guid
.
_getId
());
Object
objResponse
=
response
.
get
(
AtlasClient
.
DEFINITION
);
String
jsonResponse
=
AtlasType
.
toJson
(
objResponse
);
Referenceable
createdEntity
=
AtlasType
.
fromV1Json
(
jsonResponse
,
Referenceable
.
class
);
Object
entityAttrValue
=
createdEntity
.
get
(
attrName
);
Assert
.
assertEquals
(
createdEntity
.
get
(
attrName
),
attrValue
,
"entityId="
+
guid
+
"; objResponse="
+
objResponse
+
"; jsonResponse="
+
jsonResponse
+
"; createdEntity="
+
createdEntity
);
Assert
.
assertEquals
(
entityAttrValue
,
attrValue
,
"attrName="
+
attrName
+
"; attrValue="
+
attrValue
+
"; entityToCreate="
+
entityToCreate
+
"; entityId="
+
guid
+
"; getEntityResponse_Obj="
+
objResponse
+
"; getEntityResponse_Json="
+
jsonResponse
+
"; getEntityResponse_Entity="
+
createdEntity
);
}
...
...
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