Search in sources :

Example 16 with TestConfiguration

use of net.nemerosa.ontrack.extension.api.support.TestConfiguration in project ontrack by nemerosa.

the class ConfigurationServiceTest method replace_configuration_same.

@Test
public void replace_configuration_same() {
    TestConfiguration config = config("test");
    TestConfiguration replacedConfig = configurationService.replaceConfiguration(config, Function.identity());
    assertSame("Same config is returned", config, replacedConfig);
}
Also used : TestConfiguration(net.nemerosa.ontrack.extension.api.support.TestConfiguration) Test(org.junit.Test)

Example 17 with TestConfiguration

use of net.nemerosa.ontrack.extension.api.support.TestConfiguration in project ontrack by nemerosa.

the class TestConfigurationUncryptedAction method migrate.

@Override
public void migrate(Connection connection) throws SQLException, JsonProcessingException {
    try (PreparedStatement ps = connection.prepareStatement("INSERT INTO CONFIGURATIONS(TYPE, NAME, CONTENT) VALUES (?, ?, ?)")) {
        ps.setString(1, TestConfiguration.class.getName());
        ps.setString(2, "plain");
        ps.setString(3, objectMapper.writeValueAsString(new TestConfiguration("plain", "test", "verysecret")));
        ps.execute();
    }
}
Also used : TestConfiguration(net.nemerosa.ontrack.extension.api.support.TestConfiguration) PreparedStatement(java.sql.PreparedStatement)

Aggregations

TestConfiguration (net.nemerosa.ontrack.extension.api.support.TestConfiguration)17 Test (org.junit.Test)16 GlobalSettings (net.nemerosa.ontrack.model.security.GlobalSettings)10 Event (net.nemerosa.ontrack.model.events.Event)3 PreparedStatement (java.sql.PreparedStatement)1 TestPropertyType (net.nemerosa.ontrack.extension.api.support.TestPropertyType)1 ProjectEdit (net.nemerosa.ontrack.model.security.ProjectEdit)1 ProjectView (net.nemerosa.ontrack.model.security.ProjectView)1 Project (net.nemerosa.ontrack.model.structure.Project)1 ConnectionResult (net.nemerosa.ontrack.model.support.ConnectionResult)1