Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix integration tests #1212

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci-java-8-and-11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
run: ./mvnw clean package -Dgpg.skip
- name: Compile integration tests
run: ./mvnw -Pintegration-test test-compile compile
- if: ${{ matrix.java != 8 }}
name: Check style with Spotless
run: ./mvnw spotless:check
Expand Down
7 changes: 0 additions & 7 deletions .idea/kotlinc.xml

This file was deleted.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 12 additions & 5 deletions integration-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-junit</artifactId>
<version>2.0.0.0</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.immutables</groupId>
<artifactId>value</artifactId>
Expand All @@ -91,11 +103,6 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,13 @@

package org.cloudfoundry;

import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.rules.TestName;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.TestInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
import reactor.core.publisher.Mono;
import reactor.util.function.Tuple2;

Expand All @@ -34,33 +31,33 @@
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Method;
import java.util.Optional;
import java.util.function.Consumer;

import static org.assertj.core.api.Assertions.assertThat;
import static org.cloudfoundry.util.tuple.TupleUtils.consumer;

@RunWith(SpringRunner.class)
@ContextConfiguration(classes = IntegrationTestConfiguration.class)
@SpringJUnitConfig(classes = IntegrationTestConfiguration.class)
public abstract class AbstractIntegrationTest {

private final Logger logger = LoggerFactory.getLogger("cloudfoundry-client.test");

@Rule
public final TestName testName = new TestName();

@Autowired
@Rule
public CloudFoundryVersionConditionalRule cloudFoundryVersion;
public String testName;

@Autowired
protected NameFactory nameFactory;

@Before
public void testEntry() {
@BeforeEach
public void testEntry(TestInfo testInfo) {
Optional<Method> testMethod = testInfo.getTestMethod();
if (testMethod.isPresent()) {
this.testName = testMethod.get().getName();
}
this.logger.debug(">> {} <<", getTestName());
}

@After
@AfterEach
public final void testExit() {
this.logger.debug("<< {} >>", getTestName());
}
Expand All @@ -85,7 +82,7 @@ protected static <T> Consumer<Tuple2<T, T>> tupleEquality() {
}

private String getTestName() {
return String.format("%s.%s", this.getClass().getSimpleName(), this.testName.getMethodName());
return String.format("%s.%s", this.getClass().getSimpleName(), this.testName);
}

}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,6 @@ DefaultCloudFoundryOperations cloudFoundryOperations(CloudFoundryClient cloudFou
.build();
}

@Bean
CloudFoundryVersionConditionalRule cloudFoundryVersionConditionalRule(Version serverVersion) {
return new CloudFoundryVersionConditionalRule(serverVersion);
}

@Bean
DefaultConnectionContext connectionContext(@Value("${test.apiHost}") String apiHost,
@Value("${test.proxy.host:}") String proxyHost,
Expand Down
Loading
Loading