@Test public void singleClientConfigurationMustBeLoaded() { DbLoadedSamlClientConfigurationDto cfg = templateUnderTest.loadClient("Five"); assertNotNull(cfg); assertEquals("Five", cfg.getClientName()); byte[] keystoreData = cfg.getKeystoreBinaryData(); byte[] expectedKeystoreData = createExpectedKeystoreData((byte) 5); assertArrayEquals(expectedKeystoreData, keystoreData); assertEquals("KsPwd5", cfg.getKeystorePassword()); assertEquals("Alias5", cfg.getKeystoreAlias()); assertEquals("PrKeyPwd5", cfg.getPrivateKeyPassword()); assertEquals("CLOB-5", cfg.getIdentityProviderMetadata()); assertEquals("urn:idp5", cfg.getIdentityProviderEntityId()); assertEquals("urn:sp5", cfg.getServiceProviderEntityId()); assertEquals(5000, cfg.getMaximumAuthenticationLifetime()); assertEquals("urn:binding", cfg.getDestinationBindingType()); }
@Override @Transactional(readOnly=true) public DbLoadedSamlClientConfigurationDto loadClient(final String clientName) { if (StringUtils.isBlank(clientName)) { throw new IllegalArgumentException("Client name must not be null or empty."); } final Object[] selectSingleClientParameters = new Object[] {environment, clientName}; final List<DbLoadedSamlClientConfigurationDto> configurations = template.query(selectSingleClientSqlText, selectSingleClientParameters, selectSingleClientParameterTypes, fullRowMapper); if ((configurations != null) && (!configurations.isEmpty())) { return configurations.get(0); } else { return null; } }
SpringJdbcTemplateSamlClientDaoImpl implements SamlClientDao { @Override @Transactional(readOnly=true) public DbLoadedSamlClientConfigurationDto loadClient(final String clientName) { if (StringUtils.isBlank(clientName)) { throw new IllegalArgumentException("Client name must not be null or empty."); } final Object[] selectSingleClientParameters = new Object[] {environment, clientName}; final List<DbLoadedSamlClientConfigurationDto> configurations = template.query(selectSingleClientSqlText, selectSingleClientParameters, selectSingleClientParameterTypes, fullRowMapper); if ((configurations != null) && (!configurations.isEmpty())) { return configurations.get(0); } else { return null; } } }
SpringJdbcTemplateSamlClientDaoImpl implements SamlClientDao { @Override @Transactional(readOnly=true) public DbLoadedSamlClientConfigurationDto loadClient(final String clientName) { if (StringUtils.isBlank(clientName)) { throw new IllegalArgumentException("Client name must not be null or empty."); } final Object[] selectSingleClientParameters = new Object[] {environment, clientName}; final List<DbLoadedSamlClientConfigurationDto> configurations = template.query(selectSingleClientSqlText, selectSingleClientParameters, selectSingleClientParameterTypes, fullRowMapper); if ((configurations != null) && (!configurations.isEmpty())) { return configurations.get(0); } else { return null; } } SpringJdbcTemplateSamlClientDaoImpl(final DataSource dataSource, final LobHandler lobHandler, final String tableName, final String environment); }
SpringJdbcTemplateSamlClientDaoImpl implements SamlClientDao { @Override @Transactional(readOnly=true) public DbLoadedSamlClientConfigurationDto loadClient(final String clientName) { if (StringUtils.isBlank(clientName)) { throw new IllegalArgumentException("Client name must not be null or empty."); } final Object[] selectSingleClientParameters = new Object[] {environment, clientName}; final List<DbLoadedSamlClientConfigurationDto> configurations = template.query(selectSingleClientSqlText, selectSingleClientParameters, selectSingleClientParameterTypes, fullRowMapper); if ((configurations != null) && (!configurations.isEmpty())) { return configurations.get(0); } else { return null; } } SpringJdbcTemplateSamlClientDaoImpl(final DataSource dataSource, final LobHandler lobHandler, final String tableName, final String environment); @Override @Transactional(readOnly=true) List<String> loadClientNames(); @Override @Transactional(readOnly=true) List<DbLoadedSamlClientConfigurationDto> loadAllClients(); @Override @Transactional(readOnly=true) DbLoadedSamlClientConfigurationDto loadClient(final String clientName); }
SpringJdbcTemplateSamlClientDaoImpl implements SamlClientDao { @Override @Transactional(readOnly=true) public DbLoadedSamlClientConfigurationDto loadClient(final String clientName) { if (StringUtils.isBlank(clientName)) { throw new IllegalArgumentException("Client name must not be null or empty."); } final Object[] selectSingleClientParameters = new Object[] {environment, clientName}; final List<DbLoadedSamlClientConfigurationDto> configurations = template.query(selectSingleClientSqlText, selectSingleClientParameters, selectSingleClientParameterTypes, fullRowMapper); if ((configurations != null) && (!configurations.isEmpty())) { return configurations.get(0); } else { return null; } } SpringJdbcTemplateSamlClientDaoImpl(final DataSource dataSource, final LobHandler lobHandler, final String tableName, final String environment); @Override @Transactional(readOnly=true) List<String> loadClientNames(); @Override @Transactional(readOnly=true) List<DbLoadedSamlClientConfigurationDto> loadAllClients(); @Override @Transactional(readOnly=true) DbLoadedSamlClientConfigurationDto loadClient(final String clientName);  }