use of com.hack23.cia.service.component.agent.impl.common.jms.JmsSender in project cia by Hack23.
the class DataAgentApiITest method importWorldbankDataSuccessTest.
@Test
public void importWorldbankDataSuccessTest() throws JMSException {
final JmsSender jmsSenderMock = mock(JmsSender.class);
ReflectionTestUtils.setField(dataAgentApi, "jmsSender", jmsSenderMock);
dataAgentApi.execute(new DataAgentWorkOrder().withOperation(DataAgentOperation.IMPORT).withTarget(DataAgentTarget.MODEL_EXTERNAL_WORLDBANK));
final ArgumentCaptor<Destination> destCaptor = ArgumentCaptor.forClass(Destination.class);
final ArgumentCaptor<Serializable> stringCaptor = ArgumentCaptor.forClass(Serializable.class);
verify(jmsSenderMock, times(4)).send(destCaptor.capture(), stringCaptor.capture());
final List<Serializable> capturedStrings = stringCaptor.getAllValues();
final List<Destination> capturedDestinations = destCaptor.getAllValues();
assertNotNull(capturedStrings);
assertNotNull(capturedDestinations);
// waitUntilQueueIsEmpty("worldbank");
}
use of com.hack23.cia.service.component.agent.impl.common.jms.JmsSender in project cia by Hack23.
the class DataAgentApiITest method importRiksdagenDataSuccessTest.
/**
* Import riksdagen data success test.
* @throws JMSException
*/
@Test
public void importRiksdagenDataSuccessTest() throws JMSException {
final JmsSender jmsSenderMock = mock(JmsSender.class);
ReflectionTestUtils.setField(dataAgentApi, "jmsSender", jmsSenderMock);
dataAgentApi.execute(new DataAgentWorkOrder().withOperation(DataAgentOperation.IMPORT).withTarget(DataAgentTarget.MODEL_EXTERNAL_RIKSDAGEN));
final ArgumentCaptor<Destination> destCaptor = ArgumentCaptor.forClass(Destination.class);
final ArgumentCaptor<Serializable> stringCaptor = ArgumentCaptor.forClass(Serializable.class);
verify(jmsSenderMock, times(7)).send(destCaptor.capture(), stringCaptor.capture());
final List<Serializable> capturedStrings = stringCaptor.getAllValues();
final List<Destination> capturedDestinations = destCaptor.getAllValues();
assertNotNull(capturedStrings);
assertNotNull(capturedDestinations);
// waitUntilQueueIsEmpty("riksdagen");
}
use of com.hack23.cia.service.component.agent.impl.common.jms.JmsSender in project cia by Hack23.
the class DataAgentApiTest method importRiksdagenDataSuccessTest.
@Test
public void importRiksdagenDataSuccessTest() throws JMSException {
final DataAgentApiImpl dataAgentApiImpl = new DataAgentApiImpl();
final JmsSender jmsSenderMock = mock(JmsSender.class);
ReflectionTestUtils.setField(dataAgentApiImpl, "jmsSender", jmsSenderMock);
dataAgentApiImpl.execute(new DataAgentWorkOrder().withOperation(DataAgentOperation.IMPORT).withTarget(DataAgentTarget.MODEL_EXTERNAL_RIKSDAGEN));
final ArgumentCaptor<Destination> destCaptor = ArgumentCaptor.forClass(Destination.class);
final ArgumentCaptor<Serializable> stringCaptor = ArgumentCaptor.forClass(Serializable.class);
verify(jmsSenderMock, times(7)).send(destCaptor.capture(), stringCaptor.capture());
final List<Serializable> capturedStrings = stringCaptor.getAllValues();
final List<Destination> capturedDestinations = destCaptor.getAllValues();
assertNotNull(capturedStrings);
assertNotNull(capturedDestinations);
}
use of com.hack23.cia.service.component.agent.impl.common.jms.JmsSender in project cia by Hack23.
the class RiksdagenCommitteeProposalWorkGeneratorImplITest method generateWorkOrdersWhenAlreadyExistSuccessTest.
/**
* Generate work orders when already exist success test.
*
* @throws JMSException
* the JMS exception
*/
@Test
public void generateWorkOrdersWhenAlreadyExistSuccessTest() throws JMSException {
riksdagenDataSourcesWorkGenerator.generateWorkOrders();
final JmsSender jmsSenderMock = mock(JmsSender.class);
ReflectionTestUtils.setField(riksdagenDataSourcesWorkGenerator, "jmsSender", jmsSenderMock);
riksdagenDataSourcesWorkGenerator.generateWorkOrders();
final ArgumentCaptor<Destination> destCaptor = ArgumentCaptor.forClass(Destination.class);
final ArgumentCaptor<Serializable> stringCaptor = ArgumentCaptor.forClass(Serializable.class);
verify(jmsSenderMock, never()).send(destCaptor.capture(), stringCaptor.capture());
final List<Serializable> capturedStrings = stringCaptor.getAllValues();
final List<Destination> capturedDestinations = destCaptor.getAllValues();
assertNotNull(capturedStrings);
assertNotNull(capturedDestinations);
}
use of com.hack23.cia.service.component.agent.impl.common.jms.JmsSender in project cia by Hack23.
the class RiksdagenDocumentContentWorkGeneratorImplITest method generateWorkOrdersSuccessTest.
/**
* Generate work orders success test.
* @throws JMSException
*/
@Test
public void generateWorkOrdersSuccessTest() throws JMSException {
riksdagenDataSourcesWorkGenerator.generateWorkOrders();
final JmsSender jmsSenderMock = mock(JmsSender.class);
ReflectionTestUtils.setField(riksdagenDataSourcesWorkGenerator, "jmsSender", jmsSenderMock);
riksdagenDataSourcesWorkGenerator.generateWorkOrders();
final ArgumentCaptor<Destination> destCaptor = ArgumentCaptor.forClass(Destination.class);
final ArgumentCaptor<Serializable> stringCaptor = ArgumentCaptor.forClass(Serializable.class);
verify(jmsSenderMock, atLeastOnce()).send(destCaptor.capture(), stringCaptor.capture());
final List<Serializable> capturedStrings = stringCaptor.getAllValues();
final List<Destination> capturedDestinations = destCaptor.getAllValues();
assertNotNull(capturedStrings);
assertNotNull(capturedDestinations);
}
Aggregations