Search in sources :

Example 1 with MockPcapJobSupplier

use of org.apache.metron.rest.mock.MockPcapJobSupplier in project metron by apache.

the class PcapServiceImplTest method setUp.

@BeforeEach
public void setUp() {
    environment = mock(Environment.class);
    configuration = new Configuration();
    mockPcapJobSupplier = new MockPcapJobSupplier();
    pcapToPdmlScriptWrapper = new PcapToPdmlScriptWrapper();
    when(environment.getProperty(MetronRestConstants.PCAP_BASE_PATH_SPRING_PROPERTY)).thenReturn("/base/path");
    when(environment.getProperty(MetronRestConstants.PCAP_BASE_INTERIM_RESULT_PATH_SPRING_PROPERTY)).thenReturn("/base/interim/result/path");
    when(environment.getProperty(MetronRestConstants.PCAP_FINAL_OUTPUT_PATH_SPRING_PROPERTY)).thenReturn("/final/output/path");
    when(environment.getProperty(MetronRestConstants.PCAP_PAGE_SIZE_SPRING_PROPERTY)).thenReturn("100");
    when(environment.getProperty(MetronRestConstants.PCAP_FINALIZER_THREADPOOL_SIZE_SPRING_PROPERTY)).thenReturn("2C");
    when(environment.getProperty(MetronRestConstants.PCAP_PDML_SCRIPT_PATH_SPRING_PROPERTY)).thenReturn("/path/to/pdml/script");
    when(environment.getProperty(MetronRestConstants.USER_JOB_LIMIT_SPRING_PROPERTY, Integer.class, 1)).thenReturn(1);
}
Also used : Configuration(org.apache.hadoop.conf.Configuration) MockPcapJobSupplier(org.apache.metron.rest.mock.MockPcapJobSupplier) Environment(org.springframework.core.env.Environment) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

Configuration (org.apache.hadoop.conf.Configuration)1 MockPcapJobSupplier (org.apache.metron.rest.mock.MockPcapJobSupplier)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1 Environment (org.springframework.core.env.Environment)1