@Before public void setUp() throws Exception { binding = new JndiBindingsType.JndiBinding(); binding.setJndiName("jndi-name"); binding.setType("SIMPLE"); binding.setJdbcDriverClass("org.postgresql.Driver"); binding.setConnectionUrl("jdbc:postgresql://localhost:5432/my_db"); binding.setUserName("MyUser"); bindings = new ArrayList<>(); command = spy(DescribeJndiBindingCommand.class); ccService = mock(InternalConfigurationPersistenceService.class); cacheConfig = mock(CacheConfig.class); doReturn(ccService).when(command).getConfigurationPersistenceService(); when(ccService.getCacheConfig("cluster")).thenReturn(cacheConfig); when(cacheConfig.getJndiBindings()).thenReturn(bindings); }
@Test public void describeDataSourceWithUsernameReturnsUsername() { binding.setUserName("myUserName"); ResultModel result = command.describeDataSource(DATA_SOURCE_NAME); TabularResultModel section = result.getTableSection(DescribeDataSourceCommand.DATA_SOURCE_PROPERTIES_SECTION); assertThat(section.getValuesInRow(2)).isEqualTo(Arrays.asList("username", "myUserName")); }
configuration.setTransactionType(transactionType); configuration.setType(type.getType()); configuration.setUserName(username); configuration.setXaDatasourceClass(xaDataSource); if (dsConfigProperties != null && dsConfigProperties.length > 0)
configuration.setType(DATASOURCE_TYPE.SIMPLE.getType()); configuration.setUserName(username); if (poolProperties != null && poolProperties.length > 0) { List<ConfigProperty> configProperties = configuration.getConfigProperties();