Java Basic


  1. Which of these is not a mocking framework?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    EasyMock, jMock, Mockito, Unitils Mock, PowerMock and JMockit are a various mocking framework.


  1. How can junits be implemented using maven?











  1. 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.



  1. What is used to inject mock fields into the tested object automatically?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    @InjectMocks annotation is used to inject mock fields into the tested object automatically.


  1. How can we simulate if then behavior in Junits?











  1. 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.



  1. Which of the following is not introduced with Java 8?











  1. 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.