static List<ConfigProperty> convert( List<JndiBindingsType.JndiBinding.ConfigProperty> properties) { return properties.stream().map(p -> { ConfigProperty prop = new ConfigProperty(); prop.setName(p.getName()); prop.setType(p.getType()); prop.setValue(p.getValue()); return prop; }).collect(Collectors.toList()); } }
@Test public void validJson() { JndiBindingsType.JndiBinding.ConfigProperty configProperty = converter.convertFromText("{'name':'name','type':'type','value':'value'}", null, null); assertThat(configProperty.getName()).isEqualTo("name"); assertThat(configProperty.getType()).isEqualTo("type"); assertThat(configProperty.getValue()).isEqualTo("value"); }
assertThat(creatingDataSource).isFalse(); assertThat(jndiConfig.getJndiName()).isEqualTo("name"); assertThat(jndiConfig.getConfigProperties().get(0).getName()).isEqualTo("name1"); assertThat(targetMembers.getValue()).isEqualTo(members);
binding.getConnPooledDatasourceClass()); for (JndiBindingsType.JndiBinding.ConfigProperty confProp : binding.getConfigProperties()) { addTableRow(tabularData, confProp.getName(), confProp.getValue());
addTableRow(tabularData, confProp.getName(), confProp.getValue());
assertThat(creatingDataSource).isTrue(); assertThat(jndiConfig.getJndiName()).isEqualTo("name"); assertThat(jndiConfig.getConfigProperties().get(0).getName()).isEqualTo("name1"); assertThat(targetMembers.getValue()).isEqualTo(members);
assertThat(creatingDataSource).isFalse(); assertThat(jndiConfig.getJndiName()).isEqualTo("name"); assertThat(jndiConfig.getConfigProperties().get(0).getName()).isEqualTo("name1"); assertThat(targetMembers.getValue()).isEqualTo(members);
assertThat(creatingDataSource).isTrue(); assertThat(jndiConfig.getJndiName()).isEqualTo("name"); assertThat(jndiConfig.getConfigProperties().get(0).getName()).isEqualTo("name1"); assertThat(targetMembers.getValue()).isEqualTo(members);
/** * Get the id of the element. The id is the same as the name. * * @return the id of the element */ @Override public String getId() { return getName(); }
@Test public void validWhenTypeMissing() { JndiBindingsType.JndiBinding.ConfigProperty configProperty = converter.convertFromText("{'name':'name','value':'value'}", null, null); assertThat(configProperty.getName()).isEqualTo("name"); assertThat(configProperty.getType()).isNull(); assertThat(configProperty.getValue()).isEqualTo("value"); }