17
17
import static org .apache .camel .Exchange .HTTP_METHOD ;
18
18
import static org .apache .camel .Exchange .HTTP_QUERY ;
19
19
import 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 ;
23
23
import static org .apache .camel .util .ObjectHelper .loadResourceAsStream ;
24
24
25
25
import java .util .Properties ;
@@ -67,23 +67,17 @@ protected Properties useOverridePropertiesWithPropertiesComponent() {
67
67
68
68
@ Test
69
69
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*" );
75
72
});
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*" );
82
76
});
83
77
context .start ();
84
78
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 (
87
81
HTTP_METHOD , GET , PUT );
88
82
89
83
resultEndpoint .expectedMessageCount (1 );
@@ -99,13 +93,10 @@ public void configure() throws Exception {
99
93
100
94
@ Test
101
95
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" );
109
100
});
110
101
context .start ();
111
102
@@ -123,16 +114,13 @@ public void configure() throws Exception {
123
114
124
115
@ Test
125
116
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*" );
132
120
});
133
121
context .start ();
134
122
135
- getMockEndpoint ("mock:http4 :localhost" ).expectedMessageCount (1 );
123
+ getMockEndpoint ("mock:http :localhost" ).expectedMessageCount (1 );
136
124
137
125
resultEndpoint .expectedMessageCount (1 );
138
126
resultEndpoint .expectedHeaderReceived (HTTP_URI ,
0 commit comments