001/**
002 * Copyright 2005-2015 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.ksb.messaging;
017
018import org.apache.cxf.transport.http.HTTPException;
019
020import java.io.IOException;
021import java.net.URL;
022
023/**
024 * implementation of BogusService that is instrumented to let us know if the service method was invoked
025 */
026public class BogusServiceImpl implements BogusService {
027
028    private boolean wasCalled = false;
029
030    /**
031     * lets us know if doSomething() was called.
032     * @return
033     */
034    public boolean getWasCalled() {
035        return wasCalled;
036    }
037
038    /**
039     * This method will fail in a way that looks to BusClientFailureProxy like a dead web service endpoint.
040     * @return
041     * @throws IOException
042     */
043    @Override
044    public String doSomething() throws IOException {
045        wasCalled = true;
046        throw new HTTPException(404, "Baddy bad", new URL("http://foo.com/"));
047    }
048}