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 javax.ws.rs.core.Response.Status.CONFLICT;
009import static org.junit.Assert.assertEquals;
010
011import javax.ws.rs.core.Response;
012
013import org.fcrepo.kernel.api.exception.InvalidChecksumException;
014import org.junit.Before;
015import org.junit.Test;
016
017/**
018 * <p>InvalidChecksumExceptionMapperTest class.</p>
019 *
020 * @author awoods
021 */
022public class InvalidChecksumExceptionMapperTest {
023
024    private InvalidChecksumExceptionMapper testObj;
025
026    @Before
027    public void setUp() {
028        testObj = new InvalidChecksumExceptionMapper();
029    }
030
031    @Test
032    public void testToResponse() {
033        final InvalidChecksumException input = new InvalidChecksumException("x didn't match y");
034        final Response actual = testObj.toResponse(input);
035        assertEquals(CONFLICT.getStatusCode(), actual.getStatus());
036    }
037}