  @Test
  public void registerByTypeDoesNotCreateNewInstance() {

    when(registry).register(PrivateLanguageDriver.class);
    then(caughtException()).isInstanceOf(ScriptingException.class)
      .hasMessage("Failed to load language driver for org.apache.ibatis.scripting.LanguageDriverRegistryTest$PrivateLanguageDriver");
  }