/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019-2020 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
+
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.core.Response;
+
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
throw new IllegalStateException("port " + PORT + " is still in use");
}
- server = HttpServletServerFactoryInstance.getServerFactory().build(
- "TestExecutionPropertyRest", false, null, PORT, "/TestExecutionRest", false, false);
+ server = HttpServletServerFactoryInstance.getServerFactory().build("TestExecutionPropertyRest", false, null,
+ PORT, "/TestExecutionRest", false, false);
server.addServletClass(null, TestRestClientEndpoint.class.getName());
server.setSerializationProvider(GsonMessageBodyHandler.class.getName());
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.setErr(stderr);
LOGGER.info("testReplaceUrlTag-OUTSTRING=\n" + outString + "\nEnd-TagUrl");
- assertTrue(outString.contains("no proper URL has been set for event sending on REST client"));
+ assertTrue(outString.contains("no URL has been set for event sending on RESTCLIENT"));
}
/**
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(2000);
System.setErr(stderr);
LOGGER.info("testReplaceUrlTag-OUTSTRING=\n" + outString + "\nEnd-TagUrl");
- assertTrue(outString.contains("key\"Number\"specified on url \"http://localhost:32801/TestExecutionRest/apex"
- + "/event/{tagId}/{Number}\"not found in execution properties passed by the current policy"));
+ assertTrue(outString.contains("key \"Number\" specified on url \"http://localhost:32801/TestExecutionRest/apex"
+ + "/event/{tagId}/{Number}\" not found in execution properties passed by the current policy"));
}
/**
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();
@Test
public void testReplaceUrlMultiTag() throws Exception {
final Client client = ClientBuilder.newClient();
- final String[] args =
- { "src/test/resources/testdata/executionproperties/RESTHttpCodeFilterSetToMultiTagUrlOK.json" };
+ // @formatter:off
+ final String[] args = {
+ "src/test/resources/testdata/executionproperties/RESTHttpCodeFilterSetToMultiTagUrlOK.json"
+ };
+ // @formatter:on
final ApexMain apexMain = new ApexMain(args);
ThreadUtilities.sleep(1500);
apexMain.shutdown();