Application app = mock(BaseApplication.class);
when(app.getName()).thenReturn(TEST_APP);
// Services
List<Service> services = new ArrayList<Service>();
Service service = mock(BaseService.class);
when (service.getName()).thenReturn(TEST_COMPOSITE_SERVICE);
services.add(service);
when(app.getServices()).thenReturn(services);
// References
List<Reference> references = new ArrayList<Reference>();
Reference ref = mock(Reference.class);
when(ref.getName()).thenReturn(TEST_COMPOSITE_REFERENCE);
references.add(ref);
when(app.getReferences()).thenReturn(references);
// Bindings
Binding bind = mock(Binding.class);
List<Binding> bindings = new ArrayList<Binding>();
bindings.add(bind);
when(bind.getName()).thenReturn("xyz");
when(service.getGateways()).thenReturn(bindings);
// Transformers
List<Transformer> transformers = new ArrayList<Transformer>();
Transformer t = mock(Transformer.class);
transformers.add(t);