test_class.file: sdk/dslink/src/test/java/org/dsa/iot/dslink/handshake/LocalHandshakeTest.java
test_class.identifier: LocalHandshakeTest
test_case.body: @Test
      public void ensureFieldsExist() {
          Configuration config = new Configuration();
          config.setConnectionType(ConnectionType.WEB_SOCKET);
          config.setAuthEndpoint("http://localhost");
          config.setKeys(LocalKeys.generate());
          config.setDsId("test");
          config.setResponder(true);
  
          LocalHandshake handshake = new LocalHandshake(config);
  
          JsonObject object = handshake.toJson();
          Assert.assertNotNull(object);
  
          Assert.assertFalse(object.contains("zone"));
          config.setZone("testZone");
          handshake = new LocalHandshake(config);
          object = handshake.toJson();
          Assert.assertTrue(object.contains("zone"));
  
          Assert.assertTrue(object.contains("publicKey"));
          Assert.assertTrue(object.contains("isRequester"));
          Assert.assertTrue(object.contains("isResponder"));
      }
test_case.class_method_signature: LocalHandshakeTest.ensureFieldsExist()
test_case.full_signature: @Test public void ensureFieldsExist()
test_case.identifier: ensureFieldsExist
test_case.invocations: setConnectionType setAuthEndpoint setKeys generate setDsId setResponder toJson assertNotNull assertFalse contains setZone toJson assertTrue contains assertTrue contains assertTrue contains assertTrue contains
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void ensureFieldsExist()
focal_class.declarator: keys
focal_class.modifier: private final
focal_class.original_string: private final LocalKeys keys;
focal_class.type: LocalKeys
focal_class.var_name: keys
focal_class.declarator: publicKey
focal_class.modifier: private final
focal_class.original_string: private final String publicKey;
focal_class.type: String
focal_class.var_name: publicKey
focal_class.declarator: dsId
focal_class.modifier: private final
focal_class.original_string: private final String dsId;
focal_class.type: String
focal_class.var_name: dsId
focal_class.declarator: isRequester
focal_class.modifier: private final
focal_class.original_string: private final boolean isRequester;
focal_class.type: boolean
focal_class.var_name: isRequester
focal_class.declarator: isResponder
focal_class.modifier: private final
focal_class.original_string: private final boolean isResponder;
focal_class.type: boolean
focal_class.var_name: isResponder
focal_class.declarator: linkData
focal_class.modifier: private final
focal_class.original_string: private final JsonObject linkData;
focal_class.type: JsonObject
focal_class.var_name: linkData
focal_class.declarator: zone
focal_class.modifier: private final
focal_class.original_string: private final String zone;
focal_class.type: String
focal_class.var_name: zone
focal_class.declarator: token
focal_class.modifier: private final
focal_class.original_string: private final String token;
focal_class.type: String
focal_class.var_name: token
focal_class.file: sdk/dslink/src/main/java/org/dsa/iot/dslink/handshake/LocalHandshake.java
focal_class.identifier: LocalHandshake
focal_class.class_method_signature: LocalHandshake.LocalHandshake(Configuration config)
focal_class.full_signature: public  LocalHandshake(Configuration config)
focal_class.identifier: LocalHandshake
focal_class.modifiers: public
focal_class.parameters: (Configuration config)
focal_class.signature:  LocalHandshake(Configuration config)
focal_class.class_method_signature: LocalHandshake.getKeys()
focal_class.full_signature: public LocalKeys getKeys()
focal_class.identifier: getKeys
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: LocalKeys
focal_class.signature: LocalKeys getKeys()
focal_class.class_method_signature: LocalHandshake.getToken()
focal_class.full_signature: public String getToken()
focal_class.identifier: getToken
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getToken()
focal_class.class_method_signature: LocalHandshake.getDsId()
focal_class.full_signature: public String getDsId()
focal_class.identifier: getDsId
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getDsId()
focal_class.class_method_signature: LocalHandshake.isRequester()
focal_class.full_signature: public boolean isRequester()
focal_class.identifier: isRequester
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isRequester()
focal_class.class_method_signature: LocalHandshake.isResponder()
focal_class.full_signature: public boolean isResponder()
focal_class.identifier: isResponder
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isResponder()
focal_class.class_method_signature: LocalHandshake.toJson()
focal_class.full_signature: public JsonObject toJson()
focal_class.identifier: toJson
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: JsonObject
focal_class.signature: JsonObject toJson()
focal_method.body: public JsonObject toJson() {
          JsonObject obj = new JsonObject();
          obj.put("publicKey", publicKey);
          if (zone != null) {
              obj.put("zone", zone);
          }
          obj.put("isRequester", isRequester);
          obj.put("isResponder", isResponder);
          obj.put("linkData", linkData);
          obj.put("version", "1.0.4");
          obj.put("enableWebSocketCompression", true);
  
          /*String formats = System.getProperty(PropertyReference.FORMATS);
          String[] split = formats != null ? formats.split(",") : null;
          if (split != null && split.length > 0) {
              JsonArray array = new JsonArray();
              for (String f : split) {
                  EncodingFormat enc = EncodingFormat.toEnum(f);
                  array.add(enc.toJson());
              }
              obj.put("formats", array);
          } else {
              obj.put("formats", EncodingFormat.toJsonArray());
          }
          */
          return obj;
      }
focal_method.class_method_signature: LocalHandshake.toJson()
focal_method.full_signature: public JsonObject toJson()
focal_method.identifier: toJson
focal_method.invocations: put put put put put put put
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: JsonObject
focal_method.signature: JsonObject toJson()