mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-12 10:55:20 +02:00
More tests
This commit is contained in:
parent
ae34803025
commit
37d95f41d9
@ -24,9 +24,12 @@ import static org.hamcrest.Matchers.hasItems
|
||||
import static org.hamcrest.Matchers.not
|
||||
import static org.hamcrest.Matchers.notNullValue
|
||||
import static org.hamcrest.Matchers.stringContainsInOrder
|
||||
import static org.hamcrest.Matchers.allOf
|
||||
import static org.hamcrest.Matchers.containsString
|
||||
import static org.junit.Assert.assertThat
|
||||
|
||||
import org.hamcrest.Matchers
|
||||
|
||||
import static org.junit.Assert.assertEquals
|
||||
|
||||
class ArtifactSetVersionTest extends BasePiperTest {
|
||||
@ -128,6 +131,50 @@ class ArtifactSetVersionTest extends BasePiperTest {
|
||||
))
|
||||
}
|
||||
|
||||
@Test
|
||||
void testVersioningPushViaHTTPDisableSSLCheck() {
|
||||
|
||||
jenkinsCredentialsRule.withCredentials('myGitRepoCredentials', 'me', 'topSecret')
|
||||
|
||||
stepRule.step.artifactSetVersion(
|
||||
script: stepRule.step,
|
||||
juStabGitUtils: gitUtils,
|
||||
buildTool: 'maven',
|
||||
gitCredentialsId: 'myGitRepoCredentials',
|
||||
gitHttpsUrl: 'https://example.org/myGitRepo',
|
||||
gitPushMode: 'HTTPS',
|
||||
gitDisableSSLVerification: true)
|
||||
|
||||
// closer version checks already performed in test 'testVersioningPushViaSSH', focusing on
|
||||
// GIT related assertions here
|
||||
|
||||
assertThat(((Iterable)shellRule.shell).join(), containsString('-c http.sslVerify=false'))
|
||||
}
|
||||
|
||||
@Test
|
||||
void testVersioningPushViaHTTPDebugMode() {
|
||||
|
||||
jenkinsCredentialsRule.withCredentials('myGitRepoCredentials', 'me', 'topSecret')
|
||||
|
||||
stepRule.step.artifactSetVersion(
|
||||
script: stepRule.step,
|
||||
juStabGitUtils: gitUtils,
|
||||
buildTool: 'maven',
|
||||
gitCredentialsId: 'myGitRepoCredentials',
|
||||
gitHttpsUrl: 'https://example.org/myGitRepo',
|
||||
gitPushMode: 'HTTPS',
|
||||
debug: true)
|
||||
|
||||
// closer version checks already performed in test 'testVersioningPushViaSSH', focusing on
|
||||
// GIT related assertions here
|
||||
|
||||
assertThat(((Iterable)shellRule.shell).join(), allOf(
|
||||
containsString('GIT_CURL_VERBOSE=1'),
|
||||
containsString('GIT_TRACE=1'),
|
||||
containsString('--verbose'),
|
||||
not(containsString('&>/dev/null'))))
|
||||
}
|
||||
|
||||
@Test
|
||||
void testVersioningPushViaHTTPSEncodingDoesNotRevealSecrets() {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user