@Test public void fieldModelTest() { String descriptor = "description1"; String context = "context1"; String key = "Key1"; String configId = "Id1"; String createdAt = "2020-01-22-14-11-20-124"; String lastUpdated = "2020-01-1"; FieldValueModel testFieldValueModel = Mockito.mock(FieldValueModel.class); Map<String, FieldValueModel> keyToValues = new HashMap<>(); keyToValues.put(key, testFieldValueModel); FieldModel testFieldModel = new FieldModel(configId, descriptor, context, createdAt, lastUpdated, keyToValues); assertEquals(descriptor, testFieldModel.getDescriptorName()); assertEquals(context, testFieldModel.getContext()); assertTrue(testFieldModel.getKeyToValues().containsKey(key)); assertEquals(configId, testFieldModel.getId()); assertEquals(createdAt, testFieldModel.getCreatedAt()); assertEquals(lastUpdated, testFieldModel.getLastUpdated()); }
private FieldModel() { this(null, null, null, null, null); }
FieldModel extends Config { private FieldModel() { this(null, null, null, null, null); } }
FieldModel extends Config { private FieldModel() { this(null, null, null, null, null); } private  FieldModel();  FieldModel(String descriptorName, String context, Map<String, FieldValueModel> keyToValues);  FieldModel(String configId, String descriptorName, String context, Map<String, FieldValueModel> keyToValues);  FieldModel(String descriptorName, String context, String createdAt, String lastUpdated, Map<String, FieldValueModel> keyToValues);  FieldModel(String configId, String descriptorName, String context, String createdAt, String lastUpdated, Map<String, FieldValueModel> keyToValues); }
FieldModel extends Config { private FieldModel() { this(null, null, null, null, null); } private  FieldModel();  FieldModel(String descriptorName, String context, Map<String, FieldValueModel> keyToValues);  FieldModel(String configId, String descriptorName, String context, Map<String, FieldValueModel> keyToValues);  FieldModel(String descriptorName, String context, String createdAt, String lastUpdated, Map<String, FieldValueModel> keyToValues);  FieldModel(String configId, String descriptorName, String context, String createdAt, String lastUpdated, Map<String, FieldValueModel> keyToValues); String getDescriptorName(); String getContext(); String getCreatedAt(); String getLastUpdated(); Map<String, FieldValueModel> getKeyToValues(); void setKeyToValues(final Map<String, FieldValueModel> keyToValues); Optional<FieldValueModel> getFieldValueModel(final String key); Optional<String> getFieldValue(final String key); void putField(final String key, final FieldValueModel field); void removeField(final String key); FieldModel fill(final FieldModel fieldModel); }
FieldModel extends Config { private FieldModel() { this(null, null, null, null, null); } private  FieldModel();  FieldModel(String descriptorName, String context, Map<String, FieldValueModel> keyToValues);  FieldModel(String configId, String descriptorName, String context, Map<String, FieldValueModel> keyToValues);  FieldModel(String descriptorName, String context, String createdAt, String lastUpdated, Map<String, FieldValueModel> keyToValues);  FieldModel(String configId, String descriptorName, String context, String createdAt, String lastUpdated, Map<String, FieldValueModel> keyToValues); String getDescriptorName(); String getContext(); String getCreatedAt(); String getLastUpdated(); Map<String, FieldValueModel> getKeyToValues(); void setKeyToValues(final Map<String, FieldValueModel> keyToValues); Optional<FieldValueModel> getFieldValueModel(final String key); Optional<String> getFieldValue(final String key); void putField(final String key, final FieldValueModel field); void removeField(final String key); FieldModel fill(final FieldModel fieldModel);  }