gs gs128 Java Autoboxing - JUnits - Quiz No.1
gs gs128 Java Quiz
This quiz belongs to book/course code gs gs128 Java of gs organization. We have 136 quizzes available related to the book/course Java. This quiz has a total of 10 multiple choice questions (MCQs) to prepare and belongs to topic Java Autoboxing. NVAEducation wants its users to help them learn in an easy way. For that purpose, you are free to prepare online MCQs and quizzes.
NVAEducation also facilitates users to contribute in online competitions with other students to make a challenging situation to learn in a creative way. You can create one to one, and group competition on an topic of a book/course code. Also on NVAEducation you can get certifications by passing the online quiz test.
Question 1: JUnits are used for which type of testing?
Unit Testing
Integration Testing
System Testing
Blackbox Testing
Question 2: Which of the below statement about JUnit is false?
It is an open source framework
It provides an annotation to identify test methods
It provides test runners for running test
They cannot be run automatically
Question 3: Which of the below is an incorrect annotation with respect to JUnits?
@Test
@BeforeClass
@Junit
@AfterEach
Question 4: Which of these is not a mocking framework?
EasyMock
Mockito
PowerMock
MockJava
Question 5: Which method is used to verify the actual and expected results in Junits?
assert()
equals()
==
isEqual()
Question 6: What does assertSame() method use for assertion?
equals() method
isEqual() method
==
compare() method
Question 7: How to let junits know that they need to be run using PowerMock?
@PowerMock
@RunWith(PowerMock)
@RunWith(Junits)
@RunWith(PowerMockRunner.class)
Question 8: How can we simulate if then behavior in Junits?
if{..} else{..}
if(..){..} else{..}
Mockito.when(…).thenReturn(…);
Mockito.if(..).then(..);
Question 9: What is used to inject mock fields into the tested object automatically?
@InjectMocks
@Inject
@InjectMockObject
@Mock
Question 10: How can junits be implemented using maven?
<dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.1</version> </dependency>
<dependency> <groupId>org.junit</groupId> <artifactId>junit</artifactId> <version>4.8.1</version> </dependency>
<dependency> <groupId>mock.junit</groupId> <artifactId>junit</artifactId> <version>4.8.1</version> </dependency>
<dependency> <groupId>junits</groupId> <artifactId>junit</artifactId> <version>4.8.1</version> </dependency>