001/*
002 * Copyright 2016 DuraSpace, Inc.
003 *
004 * Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0
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.fcrepo.camel.serialization;
017
018import java.util.Properties;
019
020import org.apache.camel.EndpointInject;
021import org.apache.camel.Produce;
022import org.apache.camel.ProducerTemplate;
023import org.apache.camel.component.mock.MockEndpoint;
024import org.apache.camel.test.blueprint.CamelBlueprintTestSupport;
025
026/**
027 * Test the route workflow (property 'includeBinaries' is false).
028 *
029 * @author Bethany Seeger
030 * @since 2015-09-28
031 */
032
033public abstract class AbstractRouteTest extends CamelBlueprintTestSupport {
034
035    @EndpointInject(uri = "mock:result")
036    protected MockEndpoint resultEndpoint;
037
038    @Produce(uri = "direct:start")
039    protected ProducerTemplate template;
040
041    protected static final String baseURL = "http://localhost/rest";
042    protected static final String identifier = "/file1";
043    protected static final String auditContainer = "/audit";
044
045    @Override
046    public boolean isUseAdviceWith() {
047        return true;
048    }
049
050    @Override
051    public boolean isUseRouteBuilder() {
052        return false;
053    }
054
055    @Override
056    protected String getBlueprintDescriptor() {
057        return "/OSGI-INF/blueprint/blueprint-test.xml";
058    }
059
060    @Override
061    protected Properties useOverridePropertiesWithPropertiesComponent() {
062        final Properties props = new Properties();
063
064        props.put("serialization.stream", "seda:foo");
065        props.put("input.stream", "seda:bar");
066        props.put("serialization.format", "RDF_XML");
067        props.put("serialization.descriptions", "metadata_file");
068        props.put("serialization.binaries", "binary_file");
069        // in here to clearly show that we won't include binaries by default
070        props.put("serialization.includeBinaries", "false");
071        props.put("audit.container", auditContainer);
072
073        return props;
074    }
075}