DefaultFilter extends Filter { @Override public void applyFilter(WorkflowTrace trace) { WorkflowTraceNormalizer normalizer = new WorkflowTraceNormalizer(); normalizer.assertNormalizedWorkflowTrace(trace); List<AliasedConnection> traceConnections = trace.getConnections(); List<AliasedConnection> strippedTraceConnections = new ArrayList<>(); InboundConnection defaultInCon = config.getDefaultServerConnection().getCopy(); OutboundConnection defaultOutCon = config.getDefaultClientConnection().getCopy(); AliasedConnection lastProcessedCon = null; for (AliasedConnection traceCon : traceConnections) { ConnectionEndType localConEndType = traceCon.getLocalConnectionEndType(); if (null == localConEndType) { throw new ConfigurationException("WorkflowTrace defines a connection with an" + "empty localConnectionEndType. Don't know how to handle this!"); } else { lastProcessedCon = traceCon.getCopy(); switch (traceCon.getLocalConnectionEndType()) { case CLIENT: traceCon.filter(defaultOutCon); break; case SERVER: traceCon.filter(defaultInCon); break; default: throw new ConfigurationException("WorkflowTrace defines a connection with an" + "unknown localConnectionEndType (" + localConEndType + "). Don't know " + "how to handle this!"); } } } TlsAction defaultAction = new GeneralAction(lastProcessedCon.getAlias()); if (trace.getTlsActions() != null) { for (TlsAction action : trace.getTlsActions()) { action.filter(defaultAction); } } trace.setConnections(strippedTraceConnections); } DefaultFilter(Config config); @Override void applyFilter(WorkflowTrace trace); @Override void postFilter(WorkflowTrace trace, WorkflowTrace reference); @Override FilterType getFilterType();  }
@Test public void filterUninitializedTraceFails() { trace = new WorkflowTrace(); exception.expect(ConfigurationException.class); exception.expectMessage("Workflow trace not well defined. Trace does not define any connections."); filter.applyFilter(trace); }