001/*
002 * Licensed to DuraSpace under one or more contributor license agreements.
003 * See the NOTICE file distributed with this work for additional information
004 * regarding copyright ownership.
005 *
006 * DuraSpace licenses this file to you under the Apache License,
007 * Version 2.0 (the "License"); you may not use this file except in
008 * compliance with the License.  You may obtain a copy of the License at
009 *
010 *     http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018package org.fcrepo.camel.serialization;
019
020import java.util.Properties;
021
022import org.apache.camel.EndpointInject;
023import org.apache.camel.Produce;
024import org.apache.camel.ProducerTemplate;
025import org.apache.camel.component.mock.MockEndpoint;
026import org.apache.camel.test.blueprint.CamelBlueprintTestSupport;
027
028/**
029 * Test the route workflow (property 'includeBinaries' is false).
030 *
031 * @author Bethany Seeger
032 * @since 2015-09-28
033 */
034
035public abstract class AbstractRouteTest extends CamelBlueprintTestSupport {
036
037    @EndpointInject(uri = "mock:result")
038    protected MockEndpoint resultEndpoint;
039
040    @Produce(uri = "direct:start")
041    protected ProducerTemplate template;
042
043    protected static final String baseURL = "http://localhost/rest";
044    protected static final String identifier = "/file1";
045    protected static final String auditContainer = "/audit";
046
047    @Override
048    public boolean isUseAdviceWith() {
049        return true;
050    }
051
052    @Override
053    public boolean isUseRouteBuilder() {
054        return false;
055    }
056
057    @Override
058    protected String getBlueprintDescriptor() {
059        return "/OSGI-INF/blueprint/blueprint-test.xml";
060    }
061
062    @Override
063    protected Properties useOverridePropertiesWithPropertiesComponent() {
064        final Properties props = new Properties();
065
066        props.put("serialization.stream", "seda:foo");
067        props.put("input.stream", "seda:bar");
068        props.put("serialization.format", "RDF_XML");
069        props.put("serialization.descriptions", "metadata_file");
070        props.put("serialization.binaries", "binary_file");
071        // in here to clearly show that we won't include binaries by default
072        props.put("serialization.includeBinaries", "false");
073        props.put("filter.containers", baseURL + auditContainer);
074
075        return props;
076    }
077}