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 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(); + // } + // } +} +