1 /**
2 * Copyright 2005-2015 The Kuali Foundation
3 *
4 * Licensed under the Educational Community License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.opensource.org/licenses/ecl2.php
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.kuali.rice.ksb.messaging;
17
18 import org.apache.cxf.transport.http.HTTPException;
19
20 import java.io.IOException;
21 import java.net.URL;
22
23 /**
24 * implementation of BogusService that is instrumented to let us know if the service method was invoked
25 */
26 public class BogusServiceImpl implements BogusService {
27
28 private boolean wasCalled = false;
29
30 /**
31 * lets us know if doSomething() was called.
32 * @return
33 */
34 public boolean getWasCalled() {
35 return wasCalled;
36 }
37
38 /**
39 * This method will fail in a way that looks to BusClientFailureProxy like a dead web service endpoint.
40 * @return
41 * @throws IOException
42 */
43 @Override
44 public String doSomething() throws IOException {
45 wasCalled = true;
46 throw new HTTPException(404, "Baddy bad", new URL("http://foo.com/"));
47 }
48 }