Skip to content
Open
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
9 changes: 1 addition & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.3.RELEASE</version>
<version>2.4.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>tmp.apps</groupId>
Expand All @@ -25,13 +25,6 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>

<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId>
<version>3.4.2</version>
</dependency>

<dependency>
<groupId>org.cloudfoundry</groupId>
<artifactId>cloudfoundry-client-reactor</artifactId>
Expand Down
84 changes: 43 additions & 41 deletions src/test/java/tmp/apps/CapiOperator/service/AppServiceTest.java
Original file line number Diff line number Diff line change
@@ -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();
// }
// }
}