Skip to content

Commit

Permalink
update endpoint identifier constant use for http connection represent…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
chathuranga-jayanath-99 committed Dec 17, 2024
1 parent 969d628 commit 6f5715d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ public enum ENDPOINT_TIMEOUT_TYPE { ENDPOINT_TIMEOUT, GLOBAL_TIMEOUT, HTTP_CONNE
public static final String ANALYTICS_METADATA = "ANALYTICS_METADATA";

// Constants for the HTTP Connection
public static final String ENDPOINT_IDENTIFIER = "INTERNAL_ENDPOINT_REFERENCE";
public static final String ENDPOINT_IDENTIFIER = "_INTERNAL_ENDPOINT_REFERENCE";
public static final String BASIC_AUTH = "Basic Auth";
public static final String OAUTH = "OAuth";
public static final String OAUTH_GRANT_TYPE_AUTHORIZATION_CODE = "Authorization Code";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void testEndpointOMElementGeneration() throws XMLStreamException {
" <timeoutAction>Discard</timeoutAction>\n" +
"</http.init>";
String expectedEndpointOMElementString =
"<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\"libraryep\">" +
"<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\"library_INTERNAL_ENDPOINT_REFERENCE\">" +
"<http uri-template=\"{uri.var.base}{+uri.var.path}{+uri.var.query}\">" +
"<timeout>" +
"<responseAction>Discard</responseAction>" +
Expand Down Expand Up @@ -102,7 +102,7 @@ public void testEndpointOMElementGenerationWithoutErrorHandling() throws XMLStre
" <baseUrl>http://jsonplaceholder.typicode.com/posts</baseUrl>\n" +
"</http.init>";
String expectedEndpointOMElementString =
"<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\"libraryep\">" +
"<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\"library_INTERNAL_ENDPOINT_REFERENCE\">" +
"<http uri-template=\"{uri.var.base}{+uri.var.path}{+uri.var.query}\" />" +
"</endpoint>";
InputStream inputStream = new ByteArrayInputStream(omElementString.getBytes(StandardCharsets.UTF_8));
Expand Down Expand Up @@ -130,7 +130,7 @@ public void testEndpointOMElementGenerationWithTrace() throws XMLStreamException
" <trace>enable</trace>\n" +
"</http.init>";
String expectedEndpointOMElementString =
"<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\"libraryep\">" +
"<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\"library_INTERNAL_ENDPOINT_REFERENCE\">" +
"<http trace=\"enable\" uri-template=\"{uri.var.base}{+uri.var.path}{+uri.var.query}\" />" +
"</endpoint>";
InputStream inputStream = new ByteArrayInputStream(omElementString.getBytes(StandardCharsets.UTF_8));
Expand Down Expand Up @@ -158,7 +158,7 @@ public void testEndpointOMElementGenerationWithStatistics() throws XMLStreamExce
" <statistics>enable</statistics>\n" +
"</http.init>";
String expectedEndpointOMElementString =
"<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\"libraryep\">" +
"<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\"library_INTERNAL_ENDPOINT_REFERENCE\">" +
"<http statistics=\"enable\" uri-template=\"{uri.var.base}{+uri.var.path}{+uri.var.query}\" />" +
"</endpoint>";
InputStream inputStream = new ByteArrayInputStream(omElementString.getBytes(StandardCharsets.UTF_8));
Expand Down Expand Up @@ -187,7 +187,7 @@ public void testEndpointOMElementGenerationWithMiscellaneousDescription() throws
" <miscellaneousDescription>hello world</miscellaneousDescription>\n" +
"</http.init>";
String expectedEndpointOMElementString =
"<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\"libraryep\">" +
"<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\"library_INTERNAL_ENDPOINT_REFERENCE\">" +
"<http statistics=\"enable\" uri-template=\"{uri.var.base}{+uri.var.path}{+uri.var.query}\" />" +
"<description>hello world</description>" +
"</endpoint>";
Expand Down Expand Up @@ -218,7 +218,7 @@ public void testEndpointOMElementGenerationWithMiscellaneousProperties() throws
" <miscellaneousProperties>name1:scope1:value1,name2:scope2:value2,</miscellaneousProperties>\n" +
"</http.init>";
String expectedEndpointOMElementString =
"<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\"libraryep\">" +
"<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\"library_INTERNAL_ENDPOINT_REFERENCE\">" +
"<http statistics=\"enable\" uri-template=\"{uri.var.base}{+uri.var.path}{+uri.var.query}\" />" +
"<property name=\"name1\" scope=\"scope1\" value=\"value1\" />" +
"<property name=\"name2\" scope=\"scope2\" value=\"value2\" />" +
Expand Down Expand Up @@ -253,7 +253,7 @@ public void testEndpointOMElementGenerationWithQualityOfServiceAddressing() thro
" <qualityServiceAddressSeparateListener>enable</qualityServiceAddressSeparateListener>\n" +
"</http.init>";
String expectedEndpointOMElementString =
"<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\"libraryep\">" +
"<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\"library_INTERNAL_ENDPOINT_REFERENCE\">" +
"<http statistics=\"enable\" uri-template=\"{uri.var.base}{+uri.var.path}{+uri.var.query}\">" +
"<enableAddressing separateListener=\"true\" version=\"final\" />" +
"</http>" +
Expand Down Expand Up @@ -289,12 +289,12 @@ public void testEndpointOMElementGenerationWithQualityOfServiceSecurityPolicy()
" <qualityServiceSecurityPolicyKey>samplePolicy</qualityServiceSecurityPolicyKey>\n" +
"</http.init>";
String expectedEndpointOMElementString =
"<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\"libraryep\">" +
"<http statistics=\"enable\" uri-template=\"{uri.var.base}{+uri.var.path}{+uri.var.query}\">" +
"<enableAddressing separateListener=\"true\" version=\"final\" />" +
"<enableSec policy=\"samplePolicy\" />" +
"</http>" +
"</endpoint>";
"<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\"library_INTERNAL_ENDPOINT_REFERENCE\">" +
"<http statistics=\"enable\" uri-template=\"{uri.var.base}{+uri.var.path}{+uri.var.query}\">" +
"<enableAddressing separateListener=\"true\" version=\"final\" />" +
"<enableSec policy=\"samplePolicy\" />" +
"</http>" +
"</endpoint>";
InputStream inputStream = new ByteArrayInputStream(omElementString.getBytes(StandardCharsets.UTF_8));
OMElement documentElement =
new StAXOMBuilder(StAXUtils.createXMLStreamReader(inputStream)).getDocumentElement();
Expand Down Expand Up @@ -328,7 +328,7 @@ public void testEndpointOMElementGenerationWithQualityOfServiceSecurityInboundOu
" <qualityServiceSecurityOutboundPolicyKey>sampleOutboundPolicy</qualityServiceSecurityOutboundPolicyKey>\n" +
"</http.init>";
String expectedEndpointOMElementString =
"<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\"libraryep\">" +
"<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\"library_INTERNAL_ENDPOINT_REFERENCE\">" +
"<http statistics=\"enable\" uri-template=\"{uri.var.base}{+uri.var.path}{+uri.var.query}\">" +
"<enableAddressing separateListener=\"true\" version=\"final\" />" +
"<enableSec inboundPolicy=\"sampleInboundPolicy\" outboundPolicy=\"sampleOutboundPolicy\" />" +
Expand Down Expand Up @@ -368,7 +368,7 @@ public void testEndpointOMElementGenerationWithTimeoutActionNever() throws XMLSt
" <timeoutAction>Never</timeoutAction>\n" +
"</http.init>";
String expectedEndpointOMElementString =
"<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\"libraryep\">" +
"<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\"library_INTERNAL_ENDPOINT_REFERENCE\">" +
"<http uri-template=\"{uri.var.base}{+uri.var.path}{+uri.var.query}\">" +
"<timeout />" +
"<suspendOnFailure>" +
Expand Down Expand Up @@ -417,7 +417,7 @@ public void testEndpointOMElementGenerationWithBasicAuth() throws XMLStreamExcep
" <basicCredentialsPassword>admin</basicCredentialsPassword>\n" +
"</http.init>";
String expectedEndpointOMElementString =
"<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\"libraryep\">" +
"<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\"library_INTERNAL_ENDPOINT_REFERENCE\">" +
"<http uri-template=\"{uri.var.base}{+uri.var.path}{+uri.var.query}\">" +
"<timeout>" +
"<responseAction>Discard</responseAction>" +
Expand Down Expand Up @@ -478,7 +478,7 @@ public void testEndpointOMElementGenerationWithOAuthAuthorizationCode() throws X
" <oauthAuthorizationRefreshToken>admin</oauthAuthorizationRefreshToken>\n" +
"</http.init>";
String expectedEndpointOMElementString =
"<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\"libraryep\">" +
"<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\"library_INTERNAL_ENDPOINT_REFERENCE\">" +
"<http uri-template=\"{uri.var.base}{+uri.var.path}{+uri.var.query}\">" +
"<timeout>" +
"<responseAction>Discard</responseAction>" +
Expand Down Expand Up @@ -546,7 +546,7 @@ public void testEndpointOMElementGenerationWithOAuthAuthorizationCodeAdditionalP
" <oauthAuthorizationAdditionalProperties>name1:value1, name2:value2</oauthAuthorizationAdditionalProperties>\n" +
"</http.init>";
String expectedEndpointOMElementString =
"<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\"libraryep\">" +
"<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\"library_INTERNAL_ENDPOINT_REFERENCE\">" +
"<http uri-template=\"{uri.var.base}{+uri.var.path}{+uri.var.query}\">" +
"<timeout>" +
"<responseAction>Discard</responseAction>" +
Expand Down Expand Up @@ -618,7 +618,7 @@ public void testEndpointOMElementGenerationWithOAuthAuthorizationCodeAndExpressi
" <oauthAuthorizationRefreshToken>{$ctx:admin}</oauthAuthorizationRefreshToken>\n" +
"</http.init>";
String expectedEndpointOMElementString =
"<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\"libraryep\">" +
"<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\"library_INTERNAL_ENDPOINT_REFERENCE\">" +
"<http uri-template=\"{uri.var.base}{+uri.var.path}{+uri.var.query}\">" +
"<timeout>" +
"<responseAction>Discard</responseAction>" +
Expand Down Expand Up @@ -684,7 +684,7 @@ public void testEndpointOMElementGenerationWithOAuthClientCredentials() throws X
" <oauthClientTokenUrl>admin</oauthClientTokenUrl>\n" +
"</http.init>";
String expectedEndpointOMElementString =
"<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\"libraryep\">" +
"<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\"library_INTERNAL_ENDPOINT_REFERENCE\">" +
"<http uri-template=\"{uri.var.base}{+uri.var.path}{+uri.var.query}\">" +
"<timeout>" +
"<responseAction>Discard</responseAction>" +
Expand Down Expand Up @@ -751,7 +751,7 @@ public void testEndpointOMElementGenerationWithOAuthPassword() throws XMLStreamE
" <oauthPasswordPassword>admin</oauthPasswordPassword>\n" +
"</http.init>";
String expectedEndpointOMElementString =
"<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\"libraryep\">" +
"<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\"library_INTERNAL_ENDPOINT_REFERENCE\">" +
"<http uri-template=\"{uri.var.base}{+uri.var.path}{+uri.var.query}\">" +
"<timeout>" +
"<responseAction>Discard</responseAction>" +
Expand Down

0 comments on commit 6f5715d

Please sign in to comment.