/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.aries.classtype.parser.exceptions;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.Test;

/**
 * Tests to exercise TypeMismtachException.
 * 
 * @author cdancy
 */
public class TypeMismatchExceptionTest {

    @Test
    public void testExceptionOnNullSource() {
        try {
            throw new TypeMismatchException("Hello, World!", null);
        } catch (final Exception e) {
            assertThat(e).isInstanceOf(NullPointerException.class);
        }
    }

    @Test
    public void testExceptionOnNullSourceAndTarget() {
        try {
            throw new TypeMismatchException("Hello, World!", null, null);
        } catch (final Exception e) {
            assertThat(e).isInstanceOf(NullPointerException.class);
        }
    }

    @Test
    public void testExceptionOnNullSourceAndTargetAndThrowable() {
        try {
            throw new TypeMismatchException("Hello, World!", null, null, null);
        } catch (final Exception e) {
            assertThat(e).isInstanceOf(NullPointerException.class);
        }
    }
}

@@ -903,16 +903,40 @@
 tThat;%0A%0A
+import java.util.UUID;%0A%0A
 import o
@@ -1067,16 +1067,289 @@
 Test %7B%0A%0A
+    private static final String RANDOM_STRING = UUID.randomUUID().toString();%0A%0A    @Test%0A    public void testCreateWithSource() %7B%0A        final TypeMismatchException tme = new TypeMismatchException(RANDOM_STRING, RANDOM_STRING);%0A        assertThat(tme).isNotNull();%0A    %7D%0A%0A
     @Tes
@@ -1450,39 +1450,37 @@
 chException(
-%22Hello, World!%22
+RANDOM_STRING
 , null);%0A   
@@ -1591,32 +1591,282 @@
        %7D%0A    %7D%0A%0A
+    @Test%0A    public void testCreateWithSourceAndTarget() %7B%0A        final TypeMismatchException tme = new TypeMismatchException(RANDOM_STRING,%0A                RANDOM_STRING,%0A                RANDOM_STRING);%0A        assertThat(tme).isNotNull();%0A    %7D%0A%0A
     @Test%0A    pu
@@ -1968,39 +1968,37 @@
 chException(
-%22Hello, World!%22
+RANDOM_STRING
 , null, null
@@ -2115,32 +2115,340 @@
        %7D%0A    %7D%0A%0A
+    @Test%0A    public void testCreateWithSourceAndTargetAndThrowable() %7B%0A        final TypeMismatchException tme = new TypeMismatchException(RANDOM_STRING,%0A                RANDOM_STRING,%0A                RANDOM_STRING,%0A                new Exception(RANDOM_STRING));%0A        assertThat(tme).isNotNull();%0A    %7D%0A%0A
     @Test%0A    pu
@@ -2570,23 +2570,21 @@
 ion(
-%22Hello, World!%22
+RANDOM_STRING
 , nu

Fix jacoco warnings.