Spring と CXF REST Web サービスを使用するアプリケーションがあり、そこではすべて問題なく動作しますが、REST Web サービスの JUnit テストを書いているところ、cxf.xml ファイルが読み込まれないことがわかりました。認証データ。
JUnit テストは Spring をまったく使用しません。以下のような単純なコードを使用してクライアントを呼び出す単純な Bean テストです。
public static <RQ, RS> RS callXMLService(RQ request, String host, String path, Class<RS> responseClass)
{
WebClient client = WebClient.create(host);
client.path(path);
client.type("application/xml");
client.accept("text/xml");
RS response = client.post(request, responseClass);
int status = client.getResponse().getStatus();
if (status == 200)
{
return response;
}
return null;
}
構成をロードする必要がある BusinessApplicationContext および SpringBusFatory のポイントで、CXF 自体にブレークポイントを設定しましたが、それらは決してトリガーされません。
私が必要とするサービスに認証がない場合は機能しますが、それは cxf.xml から何も実行する必要がないからです。
JUnit テストで CXF WebClient に cxf プロパティをロードさせるにはどうすればよいですか?