Upgrade integration tests to Boot 2.0.
This commit is contained in:
@@ -30,6 +30,7 @@ buildscript {
|
||||
|
||||
ext {
|
||||
springVersion = "5.0.10.RELEASE"
|
||||
springBootVersion = "2.0.6.RELEASE"
|
||||
springCloudConnectorsVersion = "1.2.5.RELEASE"
|
||||
reactorVersion = "Bismuth-SR13"
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ plugins {
|
||||
|
||||
dependencyManagement {
|
||||
imports {
|
||||
mavenBom "org.springframework.boot:spring-boot-dependencies:2.0.6.RELEASE"
|
||||
mavenBom "org.springframework.boot:spring-boot-dependencies:${springBootVersion}"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,10 +17,6 @@
|
||||
description = 'Spring CredHub Integration Tests'
|
||||
|
||||
buildscript {
|
||||
ext {
|
||||
springBootVersion = "1.5.8.RELEASE"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'io.spring.gradle:propdeps-plugin:0.0.10.RELEASE'
|
||||
classpath 'io.spring.gradle:spring-io-plugin:0.0.8.RELEASE'
|
||||
@@ -47,7 +43,8 @@ dependencies {
|
||||
compile project(":spring-credhub-starter")
|
||||
compile("org.springframework.boot:spring-boot-starter")
|
||||
compile("org.springframework.security.oauth:spring-security-oauth2")
|
||||
|
||||
compile("org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure:2.1.0.RELEASE")
|
||||
|
||||
if (project.hasProperty("useHttpComponents")) {
|
||||
compile("org.apache.httpcomponents:httpclient:4.5.3")
|
||||
}
|
||||
@@ -55,7 +52,7 @@ dependencies {
|
||||
compile("com.squareup.okhttp3:okhttp:3.6.0")
|
||||
}
|
||||
if (project.hasProperty("useNetty")) {
|
||||
compile("io.netty:netty-all:4.1.8.Final")
|
||||
compile("io.netty:netty-all:4.1.30.Final")
|
||||
}
|
||||
|
||||
testCompile("org.springframework.boot:spring-boot-starter-test")
|
||||
|
||||
@@ -51,14 +51,14 @@ public class CertificateIntegrationTests extends CredHubIntegrationTests {
|
||||
credentials = operations.credentials();
|
||||
certificates = operations.certificates();
|
||||
|
||||
deleteCredentialIfExists(credentials, TEST_CERT_NAME);
|
||||
deleteCredentialIfExists(credentials, ROOT_CERT_NAME);
|
||||
deleteCredentialIfExists(TEST_CERT_NAME);
|
||||
deleteCredentialIfExists(ROOT_CERT_NAME);
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() {
|
||||
deleteCredentialIfExists(credentials, TEST_CERT_NAME);
|
||||
deleteCredentialIfExists(credentials, ROOT_CERT_NAME);
|
||||
deleteCredentialIfExists(TEST_CERT_NAME);
|
||||
deleteCredentialIfExists(ROOT_CERT_NAME);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -8,8 +8,7 @@ import org.springframework.credhub.autoconfig.CredHubOAuth2TemplateAutoConfigura
|
||||
import org.springframework.credhub.autoconfig.CredHubTemplateAutoConfiguration;
|
||||
import org.springframework.credhub.core.CredHubException;
|
||||
import org.springframework.credhub.core.CredHubOperations;
|
||||
import org.springframework.credhub.core.credential.CredHubCredentialOperations;
|
||||
import org.springframework.credhub.support.SimpleCredentialName;
|
||||
import org.springframework.credhub.support.CredentialName;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@@ -32,9 +31,9 @@ public abstract class CredHubIntegrationTests {
|
||||
return operations.info().version().isVersion2();
|
||||
}
|
||||
|
||||
void deleteCredentialIfExists(CredHubCredentialOperations credentialOperations, SimpleCredentialName credentialName) {
|
||||
void deleteCredentialIfExists(CredentialName credentialName) {
|
||||
try {
|
||||
credentialOperations.deleteByName(credentialName);
|
||||
operations.credentials().deleteByName(credentialName);
|
||||
} catch (CredHubException e) {
|
||||
// ignore failing deletes on cleanup
|
||||
}
|
||||
|
||||
@@ -56,12 +56,12 @@ public class CredentialIntegrationTests extends CredHubIntegrationTests {
|
||||
.excludeNumber(false)
|
||||
.includeSpecial(true);
|
||||
|
||||
deleteCredentialIfExists(credentials, CREDENTIAL_NAME);
|
||||
deleteCredentialIfExists(CREDENTIAL_NAME);
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() {
|
||||
deleteCredentialIfExists(credentials, CREDENTIAL_NAME);
|
||||
deleteCredentialIfExists(CREDENTIAL_NAME);
|
||||
|
||||
List<CredentialSummary> afterDelete = credentials.findByName(CREDENTIAL_NAME);
|
||||
assertThat(afterDelete).hasSize(0);
|
||||
|
||||
@@ -51,7 +51,7 @@ public class InterpolationIntegrationTests extends CredHubIntegrationTests {
|
||||
|
||||
@After
|
||||
public void tearDown() {
|
||||
deleteCredentialIfExists(credentials, CREDENTIAL_NAME);
|
||||
deleteCredentialIfExists(CREDENTIAL_NAME);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -44,12 +44,12 @@ public class PermissionIntegrationTests extends CredHubIntegrationTests {
|
||||
credentials = operations.credentials();
|
||||
permissions = operations.permissions();
|
||||
|
||||
deleteCredentialIfExists(credentials, CREDENTIAL_NAME);
|
||||
deleteCredentialIfExists(CREDENTIAL_NAME);
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() {
|
||||
deleteCredentialIfExists(credentials, CREDENTIAL_NAME);
|
||||
deleteCredentialIfExists(CREDENTIAL_NAME);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -48,12 +48,12 @@ public class PermissionV2IntegrationTests extends CredHubIntegrationTests {
|
||||
credentials = operations.credentials();
|
||||
permissions = operations.permissionsV2();
|
||||
|
||||
deleteCredentialIfExists(credentials, CREDENTIAL_NAME);
|
||||
deleteCredentialIfExists(CREDENTIAL_NAME);
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() {
|
||||
deleteCredentialIfExists(credentials, CREDENTIAL_NAME);
|
||||
deleteCredentialIfExists(CREDENTIAL_NAME);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
dependencyManagement {
|
||||
imports {
|
||||
mavenBom "org.springframework.boot:spring-boot-dependencies:2.0.6.RELEASE"
|
||||
mavenBom "org.springframework.boot:spring-boot-dependencies:${springBootVersion}"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,9 +26,6 @@ dependencies {
|
||||
compile project(':spring-credhub-core')
|
||||
compile("org.springframework.boot:spring-boot-autoconfigure")
|
||||
|
||||
optional("org.springframework.boot:spring-boot-starter-webflux")
|
||||
|
||||
optional("org.springframework.boot:spring-boot-starter-security")
|
||||
optional("org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure:2.1.0.RELEASE")
|
||||
|
||||
optional("org.apache.httpcomponents:httpclient") {
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
/*
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.credhub.autoconfig;
|
||||
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
|
||||
|
||||
Reference in New Issue
Block a user