001/* 002 * The contents of this file are subject to the license and copyright 003 * detailed in the LICENSE and NOTICE files at the root of the source 004 * tree. 005 */ 006package org.fcrepo.http.commons.exceptionhandlers; 007 008import static org.junit.Assert.assertEquals; 009 010import javax.ws.rs.core.Response; 011 012import org.fcrepo.kernel.api.exception.InsufficientStorageException; 013 014import org.junit.Before; 015import org.junit.Test; 016 017/** 018 * <p> 019 * InvalidChecksumExceptionMapperTest class. 020 * </p> 021 * 022 * @author Daniel Bernstein 023 * @since Oct 7, 2016 024 */ 025public class InsufficientStorageExceptionMapperTest { 026 027 private InsufficientStorageExceptionMapper testObj; 028 029 @Before 030 public void setUp() { 031 testObj = new InsufficientStorageExceptionMapper(); 032 } 033 034 @Test 035 public void testToResponse() { 036 final InsufficientStorageException input = new InsufficientStorageException( 037 "No space left on device.", null); 038 final Response actual = testObj.toResponse(input); 039 assertEquals(InsufficientStorageExceptionMapper.INSUFFICIENT_STORAGE_HTTP_CODE, actual.getStatus()); 040 } 041}