<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
- <version>3.13.2</version>
<scope>test</scope>
</dependency>
* @param hostName the host name of the engine service to connect to.
* @param port the port number of the engine service to connect to.
* @param uploadedInputStream input stream
- * @param fileDetail details on the file
* @param ignoreConflicts conflict policy
* @param forceUpdate update policy
* @return a response object in plain text confirming the upload was successful
package org.onap.policy.apex.client.deployment.rest;
import static org.junit.Assert.assertEquals;
+
import org.junit.Test;
/**
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;
import static org.assertj.core.api.Assertions.catchThrowable;
+
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
package org.onap.policy.apex.client.deployment.rest;
import static org.junit.Assert.assertEquals;
+
import org.junit.Test;
/**
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
+
import java.util.LinkedHashMap;
import java.util.Map;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
+
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import javax.ws.rs.core.Response;
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
- <version>3.13.2</version>
<scope>test</scope>
</dependency>
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
+
import java.util.LinkedHashMap;
import java.util.Map;
import org.junit.Test;
package org.onap.policy.apex.client.full.rest;
import static org.junit.Assert.assertEquals;
+
import org.junit.Test;
/**
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;
import static org.assertj.core.api.Assertions.catchThrowable;
+
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import static org.assertj.core.api.Assertions.assertThatCode;
import static org.junit.Assert.assertEquals;
+
import org.junit.Test;
/**
while (consumerThread.isAlive() && !stopOrderedFlag) {
try {
final ConsumerRecords<String, String> records =
- kafkaConsumer.poll(kafkaConsumerProperties.getConsumerPollDuration().toMillis());
+ kafkaConsumer.poll(kafkaConsumerProperties.getConsumerPollDuration());
for (final ConsumerRecord<String, String> record : records) {
traceIfTraceEnabled(record);
eventReceiver.receiveEvent(new Properties(), record.value());
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+import java.util.Set;
+
import org.junit.Test;
import org.onap.policy.apex.service.engine.main.ApexCommandLineArguments;
import org.onap.policy.apex.service.parameters.ApexParameterHandler;
import org.onap.policy.apex.service.parameters.ApexParameters;
import org.onap.policy.common.parameters.ParameterException;
-import java.util.Set;
-
/**
* Test REST Requestor carrier technology parameters.
*/
fail("test should throw an exception here");
} catch (ParameterException pe) {
assertTrue(pe.getMessage()
- .contains("HTTP header array entries must have one key and one value: [aaa, bbb, ccc]"));
+ .contains("HTTP header array entries must have one key and one value: [aaa, bbb, ccc]"));
assertTrue(pe.getMessage().trim()
- .endsWith("HTTP header array entries must have one key and one value: [aaa]"));
+ .endsWith("HTTP header array entries must have one key and one value: [aaa]"));
}
}
new ApexParameterHandler().getParameters(arguments);
ApexParameters parameters = new ApexParameterHandler().getParameters(arguments);
- RestClientCarrierTechnologyParameters rrctp0 = (RestClientCarrierTechnologyParameters) parameters
- .getEventInputParameters().get("RestClientConsumer0").getCarrierTechnologyParameters();
+ parameters.getEventInputParameters().get("RestClientConsumer0").getCarrierTechnologyParameters();
fail("test should throw an exception here");
} catch (ParameterException pe) {
- assertTrue(pe.getMessage().contains("Invalid HTTP code filter, the filter must be specified as a three digit regular expression: "));
+ assertTrue(pe.getMessage().contains(
+ "Invalid HTTP code filter, the filter must be specified as a three digit regular expression: "));
}
}
ApexParameters parameters = new ApexParameterHandler().getParameters(arguments);
RestClientCarrierTechnologyParameters rrctp0 = (RestClientCarrierTechnologyParameters) parameters
- .getEventInputParameters().get("RestClientConsumer0").getCarrierTechnologyParameters();
+ .getEventInputParameters().get("RestClientConsumer0").getCarrierTechnologyParameters();
assertEquals(0, rrctp0.getHttpHeaders().length);
RestClientCarrierTechnologyParameters rrctp1 = (RestClientCarrierTechnologyParameters) parameters
- .getEventInputParameters().get("RestClientConsumer1").getCarrierTechnologyParameters();
+ .getEventInputParameters().get("RestClientConsumer1").getCarrierTechnologyParameters();
assertEquals(3, rrctp1.getHttpHeaders().length);
assertEquals("bbb", rrctp1.getHttpHeadersAsMultivaluedMap().get("aaa").get(0));
assertEquals("ddd", rrctp1.getHttpHeadersAsMultivaluedMap().get("ccc").get(0));
ApexParameters parameters = new ApexParameterHandler().getParameters(arguments);
RestClientCarrierTechnologyParameters rrctp1 = (RestClientCarrierTechnologyParameters) parameters
- .getEventInputParameters().get("RestClientConsumer1").getCarrierTechnologyParameters();
+ .getEventInputParameters().get("RestClientConsumer1").getCarrierTechnologyParameters();
assertEquals("[1-5][0][0-5]", rrctp1.getHttpCodeFilter());
}
assertEquals(RestClientCarrierTechnologyParameters.HttpMethod.DELETE, rrctp.getHttpMethod());
assertEquals("RestClientCarrierTechnologyParameters "
- + "[url=http://some.where, httpMethod=DELETE, httpHeaders=[[aaa, bbb], [ccc, ddd]], "
- + "httpCodeFilter=[1-5][0][0-5]]", rrctp.toString());
+ + "[url=http://some.where, httpMethod=DELETE, httpHeaders=[[aaa, bbb], [ccc, ddd]], "
+ + "httpCodeFilter=[1-5][0][0-5]]", rrctp.toString());
}
@Test
public void testUrlValidation() {
- RestClientCarrierTechnologyParameters rrctp =
- new RestClientCarrierTechnologyParameters();
+ RestClientCarrierTechnologyParameters rrctp = new RestClientCarrierTechnologyParameters();
rrctp.setUrl("http://some.where.no.tag.in.url");
assertEquals("http://some.where.no.tag.in.url", rrctp.getUrl());
// Check that the request worked
if (!isPass.matches()) {
- final String errorMessage ="reception of event from URL \"" + restConsumerProperties.getUrl()
+ final String errorMessage = "reception of event from URL \"" + restConsumerProperties.getUrl()
+ "\" failed with status code " + response.getStatus() + " and message \""
+ response.readEntity(String.class) + "\"";
throw new ApexEventRuntimeException(errorMessage);
import static org.junit.Assert.assertEquals;
-import org.junit.Test;
-
import java.util.Properties;
+import org.junit.Test;
+
/**
* Test the ApexRestRequest class.
*/
*
*/
public class ApexRestRequestorConsumerTest {
+ // String constants
+ private static final String CONSUMER_NAME = "ConsumerName";
+ private static final String EVENT_NAME = "EventName";
+ private static final String EVENT_BODY = "Event body";
@Test
public void testApexRestRequestorConsumerSetup() throws ApexEventException {
ApexRestRequestorConsumer consumer = new ApexRestRequestorConsumer();
assertNotNull(consumer);
- String consumerName = "ConsumerName";
-
EventHandlerParameters consumerParameters = new EventHandlerParameters();
ApexEventReceiver incomingEventReceiver = null;
try {
- consumer.init(consumerName, consumerParameters, incomingEventReceiver);
+ consumer.init(CONSUMER_NAME, consumerParameters, incomingEventReceiver);
fail("test should throw an exception here");
} catch (ApexEventException aee) {
assertEquals("specified consumer properties are not applicable to REST Requestor consumer (ConsumerName)",
- aee.getMessage());
+ aee.getMessage());
}
RestRequestorCarrierTechnologyParameters rrctp = new RestRequestorCarrierTechnologyParameters();
consumerParameters.setCarrierTechnologyParameters(rrctp);
try {
- consumer.init(consumerName, consumerParameters, incomingEventReceiver);
+ consumer.init(CONSUMER_NAME, consumerParameters, incomingEventReceiver);
fail("test should throw an exception here");
} catch (ApexEventException aee) {
assertEquals("REST Requestor consumer (ConsumerName) must run in peered requestor mode "
- + "with a REST Requestor producer", aee.getMessage());
+ + "with a REST Requestor producer", aee.getMessage());
}
consumerParameters.setPeeredMode(EventHandlerPeeredMode.REQUESTOR, true);
rrctp.setHttpMethod(null);
try {
- consumer.init(consumerName, consumerParameters, incomingEventReceiver);
+ consumer.init(CONSUMER_NAME, consumerParameters, incomingEventReceiver);
fail("test should throw an exception here");
} catch (ApexEventException aee) {
assertEquals("no URL has been specified on REST Requestor consumer (ConsumerName)", aee.getMessage());
rrctp.setHttpMethod(RestRequestorCarrierTechnologyParameters.HttpMethod.GET);
rrctp.setUrl("ZZZZ");
try {
- consumer.init(consumerName, consumerParameters, incomingEventReceiver);
+ consumer.init(CONSUMER_NAME, consumerParameters, incomingEventReceiver);
fail("test should throw an exception here");
} catch (ApexEventException aee) {
assertEquals("invalid URL has been specified on REST Requestor consumer (ConsumerName)", aee.getMessage());
rrctp.setHttpCodeFilter("[1-5][0][0-5]");
consumerParameters.setPeerTimeout(EventHandlerPeeredMode.REQUESTOR, 0);
- consumer.init(consumerName, consumerParameters, incomingEventReceiver);
+ consumer.init(CONSUMER_NAME, consumerParameters, incomingEventReceiver);
try {
consumer.processRestRequest(null);
fail("test should throw an exception here");
} catch (Exception ex) {
- assertEquals("could not queue request \"null\" on REST Requestor consumer (ConsumerName)",
- ex.getMessage());
+ assertEquals("could not queue request \"null\" on REST Requestor consumer (ConsumerName)", ex.getMessage());
}
- assertEquals("ConsumerName", consumer.getName());
+ assertEquals(CONSUMER_NAME, consumer.getName());
assertEquals(0, consumer.getEventsReceived());
assertEquals(null, consumer.getPeeredReference(EventHandlerPeeredMode.REQUESTOR));
}
ApexRestRequestorConsumer consumer = new ApexRestRequestorConsumer();
assertNotNull(consumer);
- String consumerName = "ConsumerName";
-
EventHandlerParameters consumerParameters = new EventHandlerParameters();
- ApexEventReceiver incomingEventReceiver = null;
RestRequestorCarrierTechnologyParameters rrctp = new RestRequestorCarrierTechnologyParameters();
consumerParameters.setCarrierTechnologyParameters(rrctp);
consumerParameters.setPeeredMode(EventHandlerPeeredMode.REQUESTOR, true);
consumerParameters.setPeerTimeout(EventHandlerPeeredMode.REQUESTOR, 0);
// Test should time out requests
- consumer.init(consumerName, consumerParameters, incomingEventReceiver);
+ consumer.init(CONSUMER_NAME, consumerParameters, null);
consumer.start();
- ApexRestRequest request = new ApexRestRequest(123, null, "EventName", "Event body");
+ ApexRestRequest request = new ApexRestRequest(123, null, EVENT_NAME, EVENT_BODY);
consumer.processRestRequest(request);
ThreadUtilities.sleep(200);
consumer.stop();
ApexRestRequestorConsumer consumer = new ApexRestRequestorConsumer();
assertNotNull(consumer);
- String consumerName = "ConsumerName";
-
EventHandlerParameters consumerParameters = new EventHandlerParameters();
- ApexEventReceiver incomingEventReceiver = null;
RestRequestorCarrierTechnologyParameters rrctp = new RestRequestorCarrierTechnologyParameters();
consumerParameters.setCarrierTechnologyParameters(rrctp);
consumerParameters.setPeeredMode(EventHandlerPeeredMode.REQUESTOR, true);
properties.put("site", "onap");
properties.put("net", "org");
- consumer.init(consumerName, consumerParameters, incomingEventReceiver);
+ consumer.init(CONSUMER_NAME, consumerParameters, null);
consumer.start();
- ApexRestRequest request = new ApexRestRequest(123, properties,"EventName", "Event body");
+ ApexRestRequest request = new ApexRestRequest(123, properties, EVENT_NAME, EVENT_BODY);
consumer.processRestRequest(request);
ThreadUtilities.sleep(2000);
consumer.stop();
ApexRestRequestorConsumer consumer = new ApexRestRequestorConsumer();
assertNotNull(consumer);
- String consumerName = "ConsumerName";
-
EventHandlerParameters consumerParameters = new EventHandlerParameters();
- ApexEventReceiver incomingEventReceiver = null;
RestRequestorCarrierTechnologyParameters rrctp = new RestRequestorCarrierTechnologyParameters();
consumerParameters.setCarrierTechnologyParameters(rrctp);
consumerParameters.setPeeredMode(EventHandlerPeeredMode.REQUESTOR, true);
Properties properties = new Properties();
properties.put("site", "onap");
- consumer.init(consumerName, consumerParameters, incomingEventReceiver);
+ consumer.init(CONSUMER_NAME, consumerParameters, null);
consumer.start();
- ApexRestRequest request = new ApexRestRequest(123, properties,"EventName", "Event body");
+ ApexRestRequest request = new ApexRestRequest(123, properties, EVENT_NAME, EVENT_BODY);
consumer.processRestRequest(request);
ThreadUtilities.sleep(2000);
consumer.stop();
* Test the ApexRestRequestorProducer class.
*/
public class ApexRestRequestorProducerTest {
+ // String constants
+ private static final String PRODUCER_NAME = "ProducerName";
@Test
public void testApexRestRequestorProducerMethods() throws ApexEventException {
ApexRestRequestorProducer producer = new ApexRestRequestorProducer();
assertNotNull(producer);
- String producerName = "ProducerName";
EventHandlerParameters producerParameters = new EventHandlerParameters();
try {
- producer.init(producerName, producerParameters);
+ producer.init(PRODUCER_NAME, producerParameters);
} catch (ApexEventException aee) {
assertEquals("specified producer properties are not applicable to REST requestor producer (ProducerName)",
aee.getMessage());
RestRequestorCarrierTechnologyParameters rrctp = new RestRequestorCarrierTechnologyParameters();
producerParameters.setCarrierTechnologyParameters(rrctp);
try {
- producer.init(producerName, producerParameters);
+ producer.init(PRODUCER_NAME, producerParameters);
fail("test should throw an exception here");
} catch (ApexEventException aee) {
assertEquals("REST Requestor producer (ProducerName) must run in peered requestor mode "
producerParameters.setPeeredMode(EventHandlerPeeredMode.REQUESTOR, true);
rrctp.setUrl("ZZZZ");
try {
- producer.init(producerName, producerParameters);
+ producer.init(PRODUCER_NAME, producerParameters);
fail("test should throw an exception here");
} catch (ApexEventException aee) {
assertEquals("URL may not be specified on REST Requestor producer (ProducerName)", aee.getMessage());
rrctp.setUrl(null);
rrctp.setHttpMethod(RestRequestorCarrierTechnologyParameters.HttpMethod.GET);
try {
- producer.init(producerName, producerParameters);
+ producer.init(PRODUCER_NAME, producerParameters);
fail("test should throw an exception here");
} catch (ApexEventException aee) {
assertEquals("HTTP method may not be specified on REST Requestor producer (ProducerName)",
}
rrctp.setHttpMethod(null);
- producer.init(producerName, producerParameters);
+ producer.init(PRODUCER_NAME, producerParameters);
producer.stop();
- assertEquals("ProducerName", producer.getName());
+ assertEquals(PRODUCER_NAME, producer.getName());
assertEquals(0, producer.getEventsSent());
assertEquals(null, producer.getPeeredReference(EventHandlerPeeredMode.REQUESTOR));
}
@Test
public void testApexRestRequestorProducerRequest() throws ApexEventException {
- ApexRestRequestorProducer producer = new ApexRestRequestorProducer();
-
- String producerName = "ProducerName";
EventHandlerParameters producerParameters = new EventHandlerParameters();
RestRequestorCarrierTechnologyParameters rrctp = new RestRequestorCarrierTechnologyParameters();
rrctp.setUrl(null);
rrctp.setHttpMethod(null);
- producer.init(producerName, producerParameters);
+ ApexRestRequestorProducer producer = new ApexRestRequestorProducer();
+ producer.init(PRODUCER_NAME, producerParameters);
producer.stop();
String eventName = "EventName";
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+import java.util.Set;
+
import org.junit.Test;
import org.onap.policy.apex.service.engine.main.ApexCommandLineArguments;
import org.onap.policy.apex.service.parameters.ApexParameterHandler;
import org.onap.policy.apex.service.parameters.ApexParameters;
import org.onap.policy.common.parameters.ParameterException;
-import java.util.Set;
-
/**
* Test REST Requestor carrier technology parameters.
*/
fail("test should throw an exception here");
} catch (ParameterException pe) {
assertTrue(pe.getMessage()
- .contains("HTTP header array entries must have one key and one value: [aaa, bbb, ccc]"));
+ .contains("HTTP header array entries must have one key and one value: [aaa, bbb, ccc]"));
assertTrue(pe.getMessage().trim()
- .endsWith("HTTP header array entries must have one key and one value: [aaa]"));
+ .endsWith("HTTP header array entries must have one key and one value: [aaa]"));
}
}
ApexParameters parameters = new ApexParameterHandler().getParameters(arguments);
RestRequestorCarrierTechnologyParameters rrctp0 = (RestRequestorCarrierTechnologyParameters) parameters
- .getEventInputParameters().get("RestRequestorConsumer0").getCarrierTechnologyParameters();
+ .getEventInputParameters().get("RestRequestorConsumer0").getCarrierTechnologyParameters();
assertEquals(0, rrctp0.getHttpHeaders().length);
RestRequestorCarrierTechnologyParameters rrctp1 = (RestRequestorCarrierTechnologyParameters) parameters
- .getEventInputParameters().get("RestRequestorConsumer1").getCarrierTechnologyParameters();
+ .getEventInputParameters().get("RestRequestorConsumer1").getCarrierTechnologyParameters();
assertEquals(3, rrctp1.getHttpHeaders().length);
assertEquals("bbb", rrctp1.getHttpHeadersAsMultivaluedMap().get("aaa").get(0));
assertEquals("ddd", rrctp1.getHttpHeadersAsMultivaluedMap().get("ccc").get(0));
new ApexParameterHandler().getParameters(arguments);
ApexParameters parameters = new ApexParameterHandler().getParameters(arguments);
- RestRequestorCarrierTechnologyParameters rrctp0 = (RestRequestorCarrierTechnologyParameters) parameters
- .getEventInputParameters().get("RestRequestorConsumer0").getCarrierTechnologyParameters();
+ parameters.getEventInputParameters().get("RestRequestorConsumer0").getCarrierTechnologyParameters();
fail("test should throw an exception here");
} catch (ParameterException pe) {
- assertTrue(pe.getMessage().contains("Invalid HTTP code filter, the filter must be specified as a three digit regular expression: "));
+ assertTrue(pe.getMessage().contains(
+ "Invalid HTTP code filter, the filter must be specified as a three digit regular expression: "));
}
}
RestRequestorCarrierTechnologyParameters rrctp = new RestRequestorCarrierTechnologyParameters();
rrctp.setHttpHeaders(null);
- assertEquals(null,rrctp.getHttpHeadersAsMultivaluedMap());
+ assertEquals(null, rrctp.getHttpHeadersAsMultivaluedMap());
rrctp.setUrl("http://some.where");
assertEquals("http://some.where", rrctp.getUrl());
rrctp.setHttpCodeFilter("[1-5][0][0-5]");
- assertEquals("[1-5][0][0-5]",rrctp.getHttpCodeFilter());
+ assertEquals("[1-5][0][0-5]", rrctp.getHttpCodeFilter());
String[][] httpHeaders = new String[2][2];
httpHeaders[0][0] = "aaa";
assertEquals(RestRequestorCarrierTechnologyParameters.HttpMethod.DELETE, rrctp.getHttpMethod());
assertEquals("RESTRequestorCarrierTechnologyParameters "
- + "[url=http://some.where, httpMethod=DELETE, httpHeaders=[[aaa, bbb], [ccc, ddd]],"
- + " httpCodeFilter=[1-5][0][0-5]]", rrctp.toString());
+ + "[url=http://some.where, httpMethod=DELETE, httpHeaders=[[aaa, bbb], [ccc, ddd]],"
+ + " httpCodeFilter=[1-5][0][0-5]]", rrctp.toString());
}
@Test
public void testUrlValidation() {
- RestRequestorCarrierTechnologyParameters rrctp =
- new RestRequestorCarrierTechnologyParameters();
+ RestRequestorCarrierTechnologyParameters rrctp = new RestRequestorCarrierTechnologyParameters();
rrctp.setUrl("http://some.where.no.tag.in.url");
assertEquals("http://some.where.no.tag.in.url", rrctp.getUrl());
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
+ *
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
import com.salesforce.kafka.test.junit4.SharedKafkaTestResource;
-import java.util.concurrent.TimeUnit;
+import java.time.Duration;
import org.apache.kafka.clients.producer.Producer;
import org.apache.kafka.clients.producer.ProducerRecord;
}
}
- producer.close(1000, TimeUnit.MILLISECONDS);
+ producer.close(Duration.ofMillis(1000));
}
/**
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
+ *
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
while (subscriberThread.isAlive() && !subscriberThread.isInterrupted()) {
try {
- final ConsumerRecords<String, String> records = consumer.poll(POLL_DURATION.toMillis());
+ final ConsumerRecords<String, String> records = consumer.poll(POLL_DURATION);
for (final ConsumerRecord<String, String> record : records) {
eventsReceivedCount++;
System.out.println("****** Received event No. " + eventsReceivedCount + " ******");
package org.onap.policy.apex.testsuites.integration.uservice.adapt.restclient;
import static org.junit.Assert.assertTrue;
+
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.net.URI;
System.setOut(new PrintStream(outContent));
System.setErr(new PrintStream(errContent));
- final String[] args = {"src/test/resources/testdata/executionproperties/RESTEventBadUrl.json"};
+ final String[] args = { "src/test/resources/testdata/executionproperties/RESTEventBadUrl.json" };
final ApexMain apexMain = new ApexMain(args);
ThreadUtilities.sleep(500);
System.setOut(new PrintStream(outContent));
System.setErr(new PrintStream(errContent));
- final String[] args = {"src/test/resources/testdata/executionproperties/RESTEventNoValueSetForTag.json"};
+ final String[] args = { "src/test/resources/testdata/executionproperties/RESTEventNoValueSetForTag.json" };
final ApexMain apexMain = new ApexMain(args);
ThreadUtilities.sleep(1000);
System.setOut(new PrintStream(outContent));
System.setErr(new PrintStream(errContent));
- final String[] args = {"src/test/resources/testdata/executionproperties/RESTEventBadHttpCodeFilter.json"};
+ final String[] args = { "src/test/resources/testdata/executionproperties/RESTEventBadHttpCodeFilter.json" };
final ApexMain apexMain = new ApexMain(args);
ThreadUtilities.sleep(500);
public void testReplaceUrlTag() throws Exception {
final Client client = ClientBuilder.newClient();
- final String[] args = {"src/test/resources/testdata/executionproperties/RESTHttpCodeFilterSetToTagUrlOK.json"};
+ final String[] args =
+ { "src/test/resources/testdata/executionproperties/RESTHttpCodeFilterSetToTagUrlOK.json" };
final ApexMain apexMain = new ApexMain(args);
ThreadUtilities.sleep(1000);
apexMain.shutdown();
public void testReplaceUrlMultiTag() throws Exception {
final Client client = ClientBuilder.newClient();
final String[] args =
- {"src/test/resources/testdata/executionproperties/RESTHttpCodeFilterSetToMultiTagUrlOK.json"};
+ { "src/test/resources/testdata/executionproperties/RESTHttpCodeFilterSetToMultiTagUrlOK.json" };
final ApexMain apexMain = new ApexMain(args);
ThreadUtilities.sleep(1500);
apexMain.shutdown();
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
+
import com.google.gson.Gson;
import java.util.Map;
import java.util.Random;