/*
 * Copyright 2018 Adaptris Ltd.
 * 
 * Licensed 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.adaptris.interlok.resolver;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNull;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class ExternalResolverTest {

  @Before
  public void setUp() throws Exception {
  }

  @After
  public void tearDown() throws Exception {
  }

  @Test
  public void testResolve() {
    assertNull(ExternalResolver.resolve(null));
    assertNotEquals("%env{PATH}", ExternalResolver.resolve("%env{PATH}"));
    assertNotEquals("%sysprop{java.version}", ExternalResolver.resolve("%sysprop{java.version}"));
    assertNotEquals("%sysprop{java.version}", ExternalResolver.resolve("%sysprop{java.version}", null));
    assertEquals("hello", ExternalResolver.resolve("hello"));
    assertEquals("NOT_A_ENVVAR", ExternalResolver.resolve("%env{NOT_A_ENVVAR}"));
  }
}

@@ -768,12 +768,101 @@
 ertN
+otN
 ull;
+%0Aimport static org.junit.Assert.assertNull;%0Aimport static org.junit.Assert.assertTrue;
 %0A%0Aim
@@ -1161,32 +1161,86 @@
 resolve(null));%0A
+    assertNull(ExternalResolver.resolve(null, null));%0A
     assertNotEqu
@@ -1560,24 +1560,24 @@
 (%22hello%22));%0A
-
     assertEq
@@ -1646,14 +1646,446 @@
 AR%7D%22));%0A
+    assertEquals(%22%25payload%7BNOT_FOUND%7D%22, ExternalResolver.resolve(%22%25payload%7BNOT_FOUND%7D%22));%0A  %7D%0A%0A  @Test%0A  public void testUnresolvableException() %7B%0A    Exception e = new UnresolvableException();%0A    assertTrue(e instanceof UnresolvableException);%0A    e = new UnresolvableException(%22Some message%22);%0A    assertEquals(%22Some message%22, e.getMessage());%0A    e = new UnresolvableException(new Exception());%0A    assertNotNull(e.getCause());%0A
   %7D%0A%7D%0A

Increase unit test code coverage