/** * Asserts that the operation contains a valid reference to a fault with * the given name. Returns the fault or throws if any assertions fail. * @param operation * @param faultName * @throws Exception */ private Fault assertHasFault(Operation operation, String faultName) throws Exception { List<FaultTarget> faults = operation.getFault(); for (FaultTarget t : faults) { Fault fault = (Fault) getArtifactByTarget(t); if (fault.getNCName().equals(faultName)) { return fault; } } Assert.fail("Failed to find fault with name: " + faultName); //$NON-NLS-1$ return null; }