Home » Archives for Ram Mokkapaty » Page 4

Author Archives: Ram Mokkapaty

Avatar photo
Ram holds a master's degree in Machine Design from IT B.H.U. His expertise lies in test driven development and re-factoring. He is passionate about open source technologies and actively blogs on various java and open-source technologies like spring. He works as a principal Engineer in the logistics domain.

Apache Camel Exchange Example

Camel Exchange represents an abstraction for an exchange of messages which involves a request message and its corresponding reply or an exception message. It consists of the below components: Exchange ID – A unique ID that identifies the exchange. MEP – A pattern that denotes whether you’re using the InOnly or InOut messaging. InOnly message – Contains only a one-way ...

Read More »

Apache Camel Components Example

Applications communicate with each other using Messages via Message Channels. The end points of a message channels either consume or send messages. The components that model these end points are called ‘Endpoints’ and the factory that creates these endpoints are called Camel Components. In this article, we will see an example of registering a component using spring as well as ...

Read More »

Apache Camel CXF Example

In this article, I am going to show you an example of Apache Camel CXF. We will explore Camel’s capabilities for interacting with SOAP web services, which are commonly used in integration technology. The CXF component provides integration with Apache CXF for connecting to Java XML Web Services (JAX-WS) hosted in CXF and what is Apache CXF? Apache CXF is ...

Read More »

Apache Camel Hello World example

Bipartite Graph

In this article, I am going to show you a ‘Hello World’ example of camel. But first let me first introduce you to Apache Camel. Apache Camel is an open-source integration framework which integrates systems. Messages play an important role in integrating systems, you can decide from which source to accept message, build the routing rules to determine how to process ...

Read More »

Mockito mock static method example

In this article, I am going to show you how to mock static methods using Powermockito. PowerMock is an open source mocking library. It extends the existing mocking frameworks, such as EasyMocks and Mockito, to add even more powerful features. One of them being mocking static methods. For more information, read Powermock – Mockito Integration Example. My setup details: I am using Maven – ...

Read More »

Powermock – Mockito Integration Example

Most of the mocking frameworks in Java, including Mockito, cannot mock static methods or final classes. If we come across a situation where we need to test these components, we won’t be able to unless we re-factor the code and make them testable. For example: Making private methods packaged or protected Avoiding static methods But re-factoring at the cost of ...

Read More »

Mockito Verify Example

In this article, I am going to show you an example of Mockito Verify. To test the state, we use assert, likewise, to verify the test interactions, we use Mockito.verify. Below are my setup details: I am using Maven – the build tool Eclipse  as the IDE, version Luna 4.4.1. TestNG  is my testing framework, in case you are new to TestNG, please refer TestNG Maven Project ...

Read More »

Mockito void Method Example

In Mockito Hello World Example, we have learnt how to stub a non-void method that returns something. Sometimes we may also need to stub a void method which is what I am going to show in this article. Before I start with my example, a bit about my setup: I am using Maven – the build tool Eclipse  as the IDE, version Luna 4.4.1. ...

Read More »

Mockito Spy Example

In this article, I am going to show you an example of Mockito Spy calls. There are times when we would like to use most of the original object’s behavior but mock only a portion of it. This is called spying objects, also called partial mocking. Before I start with the example, let me first brief you about my setup: ...

Read More »

Mockito Hello World Example

You are here, it means either you are interested in the mock objects or you are already aware of Mockito, and you want to see a working example of it. Well…let me first introduce you to Mockito which is an open source mock unit testing framework for Java. In this article, I am going to show you a Hello World example ...

Read More »