/**
 * Copyright 2016 Telefonica Investigación y Desarrollo, S.A.U
 *
 * This file is part of fiware-cygnus (FI-WARE project).
 *
 * fiware-cygnus is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
 * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
 * later version.
 * fiware-cygnus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Affero General Public License along with fiware-cygnus. If not, see
 * http://www.gnu.org/licenses/.
 *
 * For those usages not covered by the GNU Affero General Public License please contact with iot_support at tid dot es
 */

package com.telefonica.iot.cygnus.utils;

import com.google.gson.Gson;
import com.telefonica.iot.cygnus.containers.NotifyContextRequest;
import org.apache.log4j.Logger;

/**
 *
 * @author frb
 */
public final class TestUtils {
    
    /**
     * Constructor. It is private since utility clasess should not have a public or default constructor.
     */
    private TestUtils() {
    } // TestUtils
    
    /**
     * Create a Json-based notificationContextRequest given the string representation of such Json.
     * @param jsonStr
     * @return The Json-based notificationContextRequest
     */
    public static NotifyContextRequest createJsonNotifyContextRequest(String jsonStr) {
        Logger logger = Logger.getLogger(NGSIUtils.class);
        NotifyContextRequest notification = null;
        Gson gson = new Gson();

        try {
            notification = gson.fromJson(jsonStr, NotifyContextRequest.class);
        } catch (Exception e) {
            logger.error(e.getMessage());
        } // try catch
        
        return notification;
    } // createJsonNotifyContextRequest
    
} // TestUtils

@@ -1027,59 +1027,85 @@
 rs.N
-otifyContextRequest;%0Aimport org.apache.log4j.Logger
+ameMappings;%0Aimport com.telefonica.iot.cygnus.containers.NotifyContextRequest
 ;%0A%0A/
@@ -1621,118 +1621,26 @@
 tr) 
-%7B%0A        Logger logger = Logger.getLogger(NGSIUtils.class);%0A        NotifyContextRequest notification = null;
+throws Exception %7B
 %0A   
@@ -1668,25 +1668,24 @@
 Gson();%0A
-%0A
         
 try %7B%0A  
@@ -1680,40 +1680,14 @@
     
-try %7B%0A            notification =
+return
  gso
@@ -1743,137 +1743,227 @@
     
-    %7D catch (Exception e) %7B
+%7D // createJsonNotifyContextRequest
 %0A    
+%0A
     
-    logger.error(e.getMessage());%0A        %7D // try catch%0A        %0A        return notification
+public static NameMappings createJsonNameMappings(String jsonStr) throws Exception %7B%0A        Gson gson = new Gson();%0A        return gson.fromJson(jsonStr, NameMappings.class)
 ;%0A  
@@ -1980,35 +1980,27 @@
 ateJsonN
-otifyContextRequest
+ameMappings
 %0A    %0A%7D 

Simplify createJsonXXX()