Unit Testing MCQ
Unit Testing MCQ
Attempt 1
Test Duration: 00:21:39 Test Start Time: Jul 16, 2022 | 10:45 AM
Test Submit Time: Jul 16, 2022 | 11:07 AM
Rank: NA Rank: NA
https://eiphexaware.examly.io/result?testId=U2FsdGVkX1%2BlESujD%2Fps24QhpDazDhGEyfJnVMdrULA268Si3QtetiiYa7U6fd7O 1/12
7/19/22, 9:46 PM Hexaware
None of these
________________ means to ensure that a transferred message has been sent and received
by the intended parties who are claiming to have sent and received the message.
Confidentiality
Authentication
Non-repudiation CORRECT
Integrity
https://eiphexaware.examly.io/result?testId=U2FsdGVkX1%2BlESujD%2Fps24QhpDazDhGEyfJnVMdrULA268Si3QtetiiYa7U6fd7O 2/12
7/19/22, 9:46 PM Hexaware
Eclipse
Ant
Maven
What is the method for validating the expected and the actual output for a given source
code given by Junit?
assert CORRECT
assertEquals
validate
equalsTest
https://eiphexaware.examly.io/result?testId=U2FsdGVkX1%2BlESujD%2Fps24QhpDazDhGEyfJnVMdrULA268Si3QtetiiYa7U6fd7O 3/12
7/19/22, 9:46 PM Hexaware
Which of the following annotation is used for creating only a single instance
TestInstance(TestInstance.LifeCycle.PER_CLASS)
TestInstance(TestInstance.LifeCycle.PER_METHOD) CORRECT
The Lambda expression when passed to the assertEquals method, gets executed first
irrespective of the test cases being pass or fail
True
False CORRECT
Show solution
Which of the following method of Assert class fails a test with no message?
https://eiphexaware.examly.io/result?testId=U2FsdGVkX1%2BlESujD%2Fps24QhpDazDhGEyfJnVMdrULA268Si3QtetiiYa7U6fd7O 4/12
7/19/22, 9:46 PM Hexaware
We cannot run the junit test from the main method of the class
TRUE
FALSE CORRECT
Which of the following is not a correct conditional annotations provided by the JUnit
Jupiter API
https://eiphexaware.examly.io/result?testId=U2FsdGVkX1%2BlESujD%2Fps24QhpDazDhGEyfJnVMdrULA268Si3QtetiiYa7U6fd7O 5/12
7/19/22, 9:46 PM Hexaware
EnabledOnJre
EnabledIf
EnabledOnRun CORRECT
EnabledIfSystemProperty
All the methods need to be static when using the BeforeAll annotation
TRUE CORRECT
FALSE
The @Nested annotation is used for grouping a particular set of test cases for a given
method. So where is this annotation placed
https://eiphexaware.examly.io/result?testId=U2FsdGVkX1%2BlESujD%2Fps24QhpDazDhGEyfJnVMdrULA268Si3QtetiiYa7U6fd7O 6/12
7/19/22, 9:46 PM Hexaware
target
test CORRECT
global
none of these
What is the method to check the test with a particular constrainted exception?
assertEquals
https://eiphexaware.examly.io/result?testId=U2FsdGVkX1%2BlESujD%2Fps24QhpDazDhGEyfJnVMdrULA268Si3QtetiiYa7U6fd7O 7/12
7/19/22, 9:46 PM Hexaware
assertExceptionThrows
assertThrows CORRECT
assert
https://eiphexaware.examly.io/result?testId=U2FsdGVkX1%2BlESujD%2Fps24QhpDazDhGEyfJnVMdrULA268Si3QtetiiYa7U6fd7O 8/12
7/19/22, 9:46 PM Hexaware
Vulnerability Scan
Vulnerability Assessment
Penetration Test
JUnitCore CORRECT
TestCase
TestSuite
TestResult
https://eiphexaware.examly.io/result?testId=U2FsdGVkX1%2BlESujD%2Fps24QhpDazDhGEyfJnVMdrULA268Si3QtetiiYa7U6fd7O 9/12
7/19/22, 9:46 PM Hexaware
How many lifecycle hooks are there for the junit test?
4 CORRECT
Confidentiality
Authentication
Authorization
Integrity CORRECT
https://eiphexaware.examly.io/result?testId=U2FsdGVkX1%2BlESujD%2Fps24QhpDazDhGEyfJnVMdrULA268Si3QtetiiYa7U6fd7O 10/12
7/19/22, 9:46 PM Hexaware
What parameters does the assertAll method take to validate all assert statements
Executables CORRECT
Array
None
validate testcases
https://eiphexaware.examly.io/result?testId=U2FsdGVkX1%2BlESujD%2Fps24QhpDazDhGEyfJnVMdrULA268Si3QtetiiYa7U6fd7O 11/12
7/19/22, 9:46 PM Hexaware
First 1 2 Last
https://eiphexaware.examly.io/result?testId=U2FsdGVkX1%2BlESujD%2Fps24QhpDazDhGEyfJnVMdrULA268Si3QtetiiYa7U6fd7O 12/12
7/19/22, 9:47 PM Hexaware
Attempt 1
Test Duration: 00:21:39 Test Start Time: Jul 16, 2022 | 10:45 AM
Test Submit Time: Jul 16, 2022 | 11:07 AM
Rank: NA Rank: NA
Which of the following method of TestResult class informs the result that a test was
completed?
https://eiphexaware.examly.io/result?testId=U2FsdGVkX1%2BlESujD%2Fps24QhpDazDhGEyfJnVMdrULA268Si3QtetiiYa7U6fd7O 1/7
7/19/22, 9:47 PM Hexaware
The review process for a particular review begins with a _____________ by the author to the
moderator in formal review.
Requirement Analysis
Goal Design
https://eiphexaware.examly.io/result?testId=U2FsdGVkX1%2BlESujD%2Fps24QhpDazDhGEyfJnVMdrULA268Si3QtetiiYa7U6fd7O 2/7
7/19/22, 9:47 PM Hexaware
2 CORRECT
Security Audit
Vulnerability Scan
Vulnerability Assessment
https://eiphexaware.examly.io/result?testId=U2FsdGVkX1%2BlESujD%2Fps24QhpDazDhGEyfJnVMdrULA268Si3QtetiiYa7U6fd7O 3/7
7/19/22, 9:47 PM Hexaware
Test Execution
Test Design
Test Success
Security Audit
Vulnerability Assessment
Penetration Test
https://eiphexaware.examly.io/result?testId=U2FsdGVkX1%2BlESujD%2Fps24QhpDazDhGEyfJnVMdrULA268Si3QtetiiYa7U6fd7O 4/7
7/19/22, 9:47 PM Hexaware
3 CORRECT
Discovery
Vulnerability Assessment
Penetration Test
https://eiphexaware.examly.io/result?testId=U2FsdGVkX1%2BlESujD%2Fps24QhpDazDhGEyfJnVMdrULA268Si3QtetiiYa7U6fd7O 5/7
7/19/22, 9:47 PM Hexaware
Both CORRECT
Which of the following method of TestSuite class adds a test to the suite?
void add(Test)
void add()
https://eiphexaware.examly.io/result?testId=U2FsdGVkX1%2BlESujD%2Fps24QhpDazDhGEyfJnVMdrULA268Si3QtetiiYa7U6fd7O 6/7
7/19/22, 9:47 PM Hexaware
First 1 2 Last
https://eiphexaware.examly.io/result?testId=U2FsdGVkX1%2BlESujD%2Fps24QhpDazDhGEyfJnVMdrULA268Si3QtetiiYa7U6fd7O 7/7