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
bc1576da
Commit
bc1576da
authored
May 30, 2017
by
apoorvnaik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UT fixes
parent
9d6ad848
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
EntityDiscoveryServiceTest.java
...org/apache/atlas/services/EntityDiscoveryServiceTest.java
+0
-3
AtlasCSRFPreventionFilterTest.java
...ache/atlas/web/filters/AtlasCSRFPreventionFilterTest.java
+9
-1
No files found.
repository/src/test/java/org/apache/atlas/services/EntityDiscoveryServiceTest.java
View file @
bc1576da
...
...
@@ -17,7 +17,6 @@
*/
package
org
.
apache
.
atlas
.
services
;
import
org.apache.atlas.TestModules.TestOnlyModule
;
import
org.apache.atlas.discovery.EntityDiscoveryService
;
import
org.apache.atlas.exception.AtlasBaseException
;
import
org.apache.atlas.model.typedef.AtlasEntityDef
;
...
...
@@ -25,14 +24,12 @@ import org.apache.atlas.type.AtlasTypeRegistry;
import
org.apache.commons.lang.StringUtils
;
import
org.powermock.reflect.Whitebox
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Guice
;
import
org.testng.annotations.Test
;
import
static
org
.
testng
.
Assert
.
assertEquals
;
import
static
org
.
testng
.
Assert
.
assertNotNull
;
import
static
org
.
testng
.
Assert
.
assertTrue
;
@Guice
(
modules
=
TestOnlyModule
.
class
)
public
class
EntityDiscoveryServiceTest
{
private
final
String
TEST_TYPE
=
"test"
;
...
...
webapp/src/test/java/org/apache/atlas/web/filters/AtlasCSRFPreventionFilterTest.java
View file @
bc1576da
...
...
@@ -24,6 +24,7 @@ import javax.servlet.ServletException;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.io.PrintWriter
;
import
static
org
.
mockito
.
Mockito
.
atLeastOnce
;
import
static
org
.
mockito
.
Mockito
.
verify
;
...
...
@@ -42,13 +43,15 @@ public class AtlasCSRFPreventionFilterTest {
// Objects to verify interactions based on request
HttpServletResponse
mockRes
=
Mockito
.
mock
(
HttpServletResponse
.
class
);
PrintWriter
mockWriter
=
Mockito
.
mock
(
PrintWriter
.
class
);
Mockito
.
when
(
mockRes
.
getWriter
()).
thenReturn
(
mockWriter
);
FilterChain
mockChain
=
Mockito
.
mock
(
FilterChain
.
class
);
// Object under test
AtlasCSRFPreventionFilter
filter
=
new
AtlasCSRFPreventionFilter
();
filter
.
doFilter
(
mockReq
,
mockRes
,
mockChain
);
verify
(
mockRes
,
atLeastOnce
()).
se
ndError
(
HttpServletResponse
.
SC_BAD_REQUEST
,
EXPECTED_MESSAGE
);
verify
(
mockRes
,
atLeastOnce
()).
se
tStatus
(
HttpServletResponse
.
SC_BAD_REQUEST
);
Mockito
.
verifyZeroInteractions
(
mockChain
);
}
...
...
@@ -96,6 +99,8 @@ public class AtlasCSRFPreventionFilterTest {
// Objects to verify interactions based on request
HttpServletResponse
mockRes
=
Mockito
.
mock
(
HttpServletResponse
.
class
);
PrintWriter
mockWriter
=
Mockito
.
mock
(
PrintWriter
.
class
);
Mockito
.
when
(
mockRes
.
getWriter
()).
thenReturn
(
mockWriter
);
FilterChain
mockChain
=
Mockito
.
mock
(
FilterChain
.
class
);
// Object under test
...
...
@@ -137,6 +142,9 @@ public class AtlasCSRFPreventionFilterTest {
// Objects to verify interactions based on request
HttpServletResponse
mockRes
=
Mockito
.
mock
(
HttpServletResponse
.
class
);
PrintWriter
mockWriter
=
Mockito
.
mock
(
PrintWriter
.
class
);
Mockito
.
when
(
mockRes
.
getWriter
()).
thenReturn
(
mockWriter
);
FilterChain
mockChain
=
Mockito
.
mock
(
FilterChain
.
class
);
// Object under test
...
...
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