1717import static org .apache .camel .Exchange .HTTP_METHOD ;
1818import static org .apache .camel .Exchange .HTTP_QUERY ;
1919import static org .apache .camel .Exchange .HTTP_URI ;
20- import static org .apache .camel .component .http4 .HttpMethods .DELETE ;
21- import static org .apache .camel .component .http4 .HttpMethods .GET ;
22- import static org .apache .camel .component .http4 .HttpMethods .PUT ;
20+ import static org .apache .camel .component .http .HttpMethods .DELETE ;
21+ import static org .apache .camel .component .http .HttpMethods .GET ;
22+ import static org .apache .camel .component .http .HttpMethods .PUT ;
2323import static org .apache .camel .util .ObjectHelper .loadResourceAsStream ;
2424
2525import java .util .Properties ;
@@ -67,23 +67,17 @@ protected Properties useOverridePropertiesWithPropertiesComponent() {
6767
6868 @ Test
6969 public void testUpdate () throws Exception {
70- context .getRouteDefinition ("TrellisLdpathFormatter" ).adviceWith (context , new AdviceWithRouteBuilder () {
71- @ Override
72- public void configure () throws Exception {
73- mockEndpointsAndSkip ("http*" );
74- }
70+ AdviceWithRouteBuilder .adviceWith (context , "TrellisLdpathFormatter" , builder -> {
71+ builder .mockEndpointsAndSkip ("http*" );
7572 });
76- context .getRouteDefinition ("TrellisElasticsearchUpdater" ).adviceWith (context , new AdviceWithRouteBuilder () {
77- @ Override
78- public void configure () throws Exception {
79- weaveAddLast ().to ("mock:results" );
80- mockEndpointsAndSkip ("http*" );
81- }
73+ AdviceWithRouteBuilder .adviceWith (context , "TrellisElasticsearchUpdater" , builder -> {
74+ builder .weaveAddLast ().to ("mock:results" );
75+ builder .mockEndpointsAndSkip ("http*" );
8276 });
8377 context .start ();
8478
85- getMockEndpoint ("mock:http4 :localhost" ).expectedMessageCount (2 );
86- getMockEndpoint ("mock:http4 :localhost" ).expectedHeaderValuesReceivedInAnyOrder (
79+ getMockEndpoint ("mock:http :localhost" ).expectedMessageCount (2 );
80+ getMockEndpoint ("mock:http :localhost" ).expectedHeaderValuesReceivedInAnyOrder (
8781 HTTP_METHOD , GET , PUT );
8882
8983 resultEndpoint .expectedMessageCount (1 );
@@ -99,13 +93,10 @@ public void configure() throws Exception {
9993
10094 @ Test
10195 public void testFetch () throws Exception {
102- context .getRouteDefinition ("TrellisLdpathFormatter" ).adviceWith (context , new AdviceWithRouteBuilder () {
103- @ Override
104- public void configure () throws Exception {
105- mockEndpointsAndSkip ("http*" );
106- mockEndpointsAndSkip ("direct:update.elasticsearch" );
107- weaveAddLast ().to ("mock:results" );
108- }
96+ AdviceWithRouteBuilder .adviceWith (context , "TrellisLdpathFormatter" , builder -> {
97+ builder .mockEndpointsAndSkip ("http*" );
98+ builder .mockEndpointsAndSkip ("direct:update.elasticsearch" );
99+ builder .weaveAddLast ().to ("mock:results" );
109100 });
110101 context .start ();
111102
@@ -123,16 +114,13 @@ public void configure() throws Exception {
123114
124115 @ Test
125116 public void testDelete () throws Exception {
126- context .getRouteDefinition ("TrellisElasticsearchDeleter" ).adviceWith (context , new AdviceWithRouteBuilder () {
127- @ Override
128- public void configure () throws Exception {
129- weaveAddLast ().to ("mock:results" );
130- mockEndpointsAndSkip ("http*" );
131- }
117+ AdviceWithRouteBuilder .adviceWith (context , "TrellisElasticsearchDeleter" , builder -> {
118+ builder .weaveAddLast ().to ("mock:results" );
119+ builder .mockEndpointsAndSkip ("http*" );
132120 });
133121 context .start ();
134122
135- getMockEndpoint ("mock:http4 :localhost" ).expectedMessageCount (1 );
123+ getMockEndpoint ("mock:http :localhost" ).expectedMessageCount (1 );
136124
137125 resultEndpoint .expectedMessageCount (1 );
138126 resultEndpoint .expectedHeaderReceived (HTTP_URI ,
0 commit comments