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
a7869bee
Commit
a7869bee
authored
Jun 21, 2016
by
Suma Shivaprasad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-931 Delete entities fails when hard delete is configured (dkantor via sumasai)
parent
7666ae99
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
3 deletions
+75
-3
release-log.txt
release-log.txt
+1
-0
EntityResource.java
...n/java/org/apache/atlas/web/resources/EntityResource.java
+0
-3
EntityResourceTest.java
...va/org/apache/atlas/web/resources/EntityResourceTest.java
+74
-0
No files found.
release-log.txt
View file @
a7869bee
...
...
@@ -40,6 +40,7 @@ ATLAS-409 Atlas will not import avro tables with schema read from a file (dosset
ATLAS-379 Create sqoop and falcon metadata addons (venkatnrangan,bvellanki,sowmyaramesh via shwethags)
ALL CHANGES:
ATLAS-931 Delete entities fails when hard delete is configured (dkantor via sumasai)
ATLAS-932 UI: 'create tag' button does not work (mneethiraj via sumasai)
ATLAS-928 UI is not showing the name column for hive tables in the schema tab (yhemanth via sumasai)
ATLAS-922 remove test atlas-application.properties embedded in atlas-typesystem.jar ( mneethiraj via sumasai)
...
...
webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java
View file @
a7869bee
...
...
@@ -216,9 +216,6 @@ public class EntityResource {
if
(
sample
==
null
)
{
sample
=
getSample
(
entityResult
.
getUpdateEntities
());
}
if
(
sample
==
null
)
{
sample
=
getSample
(
entityResult
.
getDeletedEntities
());
}
return
sample
;
}
...
...
webapp/src/test/java/org/apache/atlas/web/resources/EntityResourceTest.java
0 → 100644
View file @
a7869bee
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
apache
.
atlas
.
web
.
resources
;
import
static
org
.
mockito
.
Mockito
.
never
;
import
static
org
.
mockito
.
Mockito
.
verify
;
import
static
org
.
mockito
.
Mockito
.
when
;
import
java.util.Collections
;
import
java.util.List
;
import
javax.ws.rs.core.Response
;
import
org.apache.atlas.AtlasClient.EntityResult
;
import
org.apache.atlas.services.MetadataService
;
import
org.mockito.Matchers
;
import
org.mockito.Mock
;
import
org.mockito.MockitoAnnotations
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
/**
* Unit test of {@link EntityResource}
*/
public
class
EntityResourceTest
{
private
static
final
String
DELETED_GUID
=
"deleted_guid"
;
@Mock
MetadataService
mockService
;
@BeforeMethod
public
void
setUp
()
{
MockitoAnnotations
.
initMocks
(
this
);
}
@Test
public
void
testDeleteEntitiesDoesNotLookupDeletedEntity
()
throws
Exception
{
List
<
String
>
guids
=
Collections
.
singletonList
(
DELETED_GUID
);
// Create EntityResult with a deleted guid and no other guids.
EntityResult
entityResult
=
new
EntityResult
(
Collections
.<
String
>
emptyList
(),
Collections
.<
String
>
emptyList
(),
guids
);
when
(
mockService
.
deleteEntities
(
guids
)).
thenReturn
(
entityResult
);
// Create EntityResource with mock MetadataService.
EntityResource
entityResource
=
new
EntityResource
(
mockService
);
Response
response
=
entityResource
.
deleteEntities
(
guids
,
null
,
null
,
null
);
// Verify that if the EntityResult returned by MetadataService includes only deleted guids,
// deleteEntities() does not perform any entity lookup.
verify
(
mockService
,
never
()).
getEntityDefinition
(
Matchers
.
anyString
());
EntityResult
resultFromEntityResource
=
EntityResult
.
fromString
(
response
.
getEntity
().
toString
());
Assert
.
assertTrue
(
resultFromEntityResource
.
getDeletedEntities
().
contains
(
DELETED_GUID
));
}
}
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