001/** 002 * Copyright 2015 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.sword.integration; 017 018import org.apache.http.HttpResponse; 019import org.apache.http.client.methods.HttpGet; 020import org.fcrepo.sword.provider.SWORDServiceProvider; 021import org.junit.Test; 022 023import java.io.IOException; 024 025import static org.fcrepo.sword.integration.Assert.assertStatusCode; 026 027/** 028 * @author claussni 029 */ 030public class ContainerInitializationIT extends BaseServiceProviderIT { 031 032 @Test 033 public void initializesRootContainer() throws IOException { 034 final HttpGet get = new HttpGet(String.format("http://%s:%s/%s", 035 HOSTNAME, 036 SERVER_PORT, 037 SWORDServiceProvider.SWORD_ROOT_PATH)); 038 final HttpResponse response = httpClient.execute(get); 039 assertStatusCode(200, response); 040 } 041 042 @Test 043 public void initializesWorkspacesContainer() throws IOException { 044 final HttpGet get = new HttpGet(String.format("http://%s:%s/%s", 045 HOSTNAME, 046 SERVER_PORT, 047 SWORDServiceProvider.SWORD_WORKSPACES_PATH)); 048 final HttpResponse response = httpClient.execute(get); 049 assertStatusCode(200, response); 050 } 051 052 @Test 053 public void initializesCollectionsContainer() throws IOException { 054 final HttpGet get = new HttpGet(String.format("http://%s:%s/%s", 055 HOSTNAME, 056 SERVER_PORT, 057 SWORDServiceProvider.SWORD_COLLECTIONS_PATH)); 058 final HttpResponse response = httpClient.execute(get); 059 assertStatusCode(200, response); 060 } 061 062}