Java Basic
- Which of these is not a mocking framework?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
EasyMock, jMock, Mockito, Unitils Mock, PowerMock and JMockit are a various mocking framework.
- How can junits be implemented using maven?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
JUnits can be used using dependency tag in maven in pom.xml. The version as desired and available in repository can be used.
- What is used to inject mock fields into the tested object automatically?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
@InjectMocks annotation is used to inject mock fields into the tested object automatically.
- How can we simulate if then behavior in Junits?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
Mockito.when(mockList.size()).thenReturn(100); assertEquals(100, mockList.size()); is the usage to implement if and then behavior.
- Which of the following is not introduced with Java 8?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Serialization is not introduced with Java 8. It was introduced with an earlier version of Java.