TaskDataProviderServiceImpl implements TaskDataProviderService, OsgiServiceLifecycleListener { @Override @Transactional public TaskDataProvider getProvider(String name) { return dataProviderDataService.findByName(name); } @Autowired  TaskDataProviderServiceImpl(EventRelay eventRelay);  TaskDataProviderServiceImpl(EventRelay eventRelay, MotechJsonReader motechJsonReader); @Override @Transactional void registerProvider(final String body); @Override @Transactional void registerProvider(final InputStream stream); @Override @Transactional TaskDataProvider getProvider(String name); @Override @Transactional TaskDataProvider getProviderById(Long providerId); @Override @Transactional List<TaskDataProvider> getProviders(); @Override @Transactional void bind(Object service, Map properties); @Override void unbind(Object service, Map properties); @Override @Transactional void unregister(String providerName);  }
@Test public void shouldGetProviderByName() { TaskDataProvider provider = new TaskDataProvider(PROVIDER_NAME, new ArrayList<TaskDataProviderObject>()); when(dataProviderDataService.findByName(PROVIDER_NAME)).thenReturn(provider); assertEquals(provider, taskDataProviderService.getProvider(PROVIDER_NAME)); }