blob: 779966a2ba4bcc1ac95389c93493998f1f39c0a2 [file] [log] [blame]
Thomas Vachuskab4258a92015-06-16 11:40:49 -07001/*
2 * Copyright 2015 Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.rest.exceptions;
17
18import org.junit.Test;
19
20import static org.junit.Assert.*;
21
22/**
23 * Set of tests for the various exception mappers.
24 */
25public class ExceptionMapperTest {
26
27 @Test
28 public void emptyMessage() {
29 RuntimeException exception = new NullPointerException();
30 ServerErrorMapper mapper = new ServerErrorMapper();
31 Object response = mapper.toResponse(exception).getEntity();
32 assertTrue("incorrect response",
33 response.toString().contains("ExceptionMapperTest.emptyMessage("));
34 }
35}