From a3cccd1e5f156f813ef7f0689fdc916821173e3c Mon Sep 17 00:00:00 2001 From: vchrisb Date: Mon, 25 Jan 2021 15:34:00 +0100 Subject: [PATCH 1/2] Add Exception Handling for AppServiceTest --- .../CapiOperator/service/AppServiceTest.java | 84 ++++++++++--------- 1 file changed, 43 insertions(+), 41 deletions(-) diff --git a/src/test/java/tmp/apps/CapiOperator/service/AppServiceTest.java b/src/test/java/tmp/apps/CapiOperator/service/AppServiceTest.java index ad4aa63..20c532d 100644 --- a/src/test/java/tmp/apps/CapiOperator/service/AppServiceTest.java +++ b/src/test/java/tmp/apps/CapiOperator/service/AppServiceTest.java @@ -1,41 +1,43 @@ -package tmp.apps.CapiOperator.service; - -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.core.io.ClassPathResource; -import org.springframework.test.context.ActiveProfiles; - -import static org.junit.jupiter.api.Assertions.fail; - -@SpringBootTest -@ActiveProfiles("test") -class AppServiceTest { - - @Autowired - AppService appService; - - @Test - void createApp_Mini() { - appService.createStaticApp("static_small", - new ClassPathResource("static_small.zip").getFile().getAbsolutePath()); - - } - - @Test - void createApp_Bigger() { - // This will throw: org.cloudfoundry.client.v2.ClientV2Exception: CF-AppBitsUploadInvalid(160001): The app upload is invalid: Invalid zip archive. - appService.createStaticApp("static_big", - new ClassPathResource("static_big.zip").getFile().getAbsolutePath()); - } - -// @Test -// void deleteApp() { -// try { -// appService.deleteApp("static_small"); - // } catch (Throwable e) { - // fail(); - // } - // } -} - +package tmp.apps.CapiOperator.service; + +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.core.io.ClassPathResource; +import org.springframework.test.context.ActiveProfiles; + +import java.io.IOException; + +import static org.junit.jupiter.api.Assertions.fail; + +@SpringBootTest +@ActiveProfiles("test") +class AppServiceTest { + + @Autowired + AppService appService; + + @Test + void createApp_Mini() throws IOException, InterruptedException { + appService.createStaticApp("static_small", + new ClassPathResource("static_small.zip").getFile().getAbsolutePath()); + + } + + @Test + void createApp_Bigger() throws IOException, InterruptedException { + // This will throw: org.cloudfoundry.client.v2.ClientV2Exception: CF-AppBitsUploadInvalid(160001): The app upload is invalid: Invalid zip archive. + appService.createStaticApp("static_big", + new ClassPathResource("static_big.zip").getFile().getAbsolutePath()); + } + +// @Test +// void deleteApp() { +// try { +// appService.deleteApp("static_small"); + // } catch (Throwable e) { + // fail(); + // } + // } +} + From 9a4ccfcc5102660ef76c798dfc71ea11ff5f14ee Mon Sep 17 00:00:00 2001 From: vchrisb Date: Tue, 26 Jan 2021 20:31:08 +0100 Subject: [PATCH 2/2] update to Spring Boot 2.4 `cf-java-client` 5.1 requires Spring Boot 2.4 --- pom.xml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index dee9f67..2a07518 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.boot spring-boot-starter-parent - 2.3.3.RELEASE + 2.4.2 tmp.apps @@ -25,13 +25,6 @@ org.springframework.boot spring-boot-starter - - - io.projectreactor - reactor-core - 3.4.2 - - org.cloudfoundry cloudfoundry-client-reactor