use of com.bakdata.quick.common.api.model.manager.creation.ApplicationCreationData in project quick by bakdata.
the class ApplicationControllerTest method shouldDeployApplication.
@Test
void shouldDeployApplication() {
final ApplicationCreationData applicationCreationData = new ApplicationCreationData(NAME, REGISTRY, IMAGE_NAME, TAG, REPLICAS, PORT, null, ARGS);
when(this.service.deployApplication(applicationCreationData)).thenReturn(Completable.complete());
final Completable completable = this.applicationClient.deployApplication(applicationCreationData);
Optional.ofNullable(completable.blockingGet()).ifPresent(Assertions::fail);
}
use of com.bakdata.quick.common.api.model.manager.creation.ApplicationCreationData in project quick by bakdata.
the class ApplicationControllerTest method shouldCallDeployApplication.
@Test
void shouldCallDeployApplication() {
final ApplicationCreationData applicationCreationData = new ApplicationCreationData(NAME, REGISTRY, IMAGE_NAME, TAG, REPLICAS, PORT, null, ARGS);
when(this.service.deployApplication(applicationCreationData)).thenReturn(Completable.complete());
this.httpClient.toBlocking().exchange(POST("/application/", applicationCreationData));
verify(this.service).deployApplication(applicationCreationData);
}
use of com.bakdata.quick.common.api.model.manager.creation.ApplicationCreationData in project quick by bakdata.
the class KubernetesApplicationServiceTest method deployApplication.
private void deployApplication(@Nullable final Integer port, final Map<String, String> arguments) {
final ApplicationCreationData applicationCreationData = new ApplicationCreationData(APP_NAME, DOCKER_REGISTRY, IMAGE_NAME, DEFAULT_IMAGE_TAG, 1, port, null, arguments);
final Completable completable = this.service.deployApplication(applicationCreationData);
Optional.ofNullable(completable.blockingGet()).ifPresent(Assertions::fail);
}
use of com.bakdata.quick.common.api.model.manager.creation.ApplicationCreationData in project quick by bakdata.
the class KubernetesApplicationServiceTest method shouldRejectDuplicateApplicationCreation.
@Test
void shouldRejectDuplicateApplicationCreation() {
final ApplicationCreationData applicationCreationData = new ApplicationCreationData(APP_NAME, DOCKER_REGISTRY, IMAGE_NAME, DEFAULT_IMAGE_TAG, 1, DEFAULT_PORT, null, Map.of());
final Completable firstDeployment = this.service.deployApplication(applicationCreationData);
Optional.ofNullable(firstDeployment.blockingGet()).ifPresent(Assertions::fail);
final Throwable invalidDeployment = this.service.deployApplication(applicationCreationData).blockingGet();
assertThat(invalidDeployment).isInstanceOf(BadArgumentException.class).hasMessageContaining(String.format("The resource with the name %s already exists", APP_NAME));
}
Aggregations