Skip to content

Commit

Permalink
fix: Fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
ovidiupopa07 committed Feb 1, 2024
1 parent d183e88 commit 7d98f02
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 81 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.squareup.okhttp.mockwebserver.MockResponse;
import com.squareup.okhttp.mockwebserver.MockWebServer;
import com.squareup.okhttp.mockwebserver.RecordedRequest;
import groovy.util.logging.Slf4j;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
Expand All @@ -33,10 +34,15 @@
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.TestPropertySource;

@ActiveProfiles("echo")
@Slf4j
@DirtiesContext
@SpringBootTest(classes = {Main.class})
@TestPropertySource(properties = {"spring.config.location=classpath:gate-echo.yml"})
@TestPropertySource("/application-echo.properties")
class EchoServiceTest {

@Autowired EchoService echoService;
Expand All @@ -47,11 +53,9 @@ class EchoServiceTest {

@BeforeAll
static void setUp() throws IOException {
echoServer = new MockWebServer();
echoServer.start(8089);

clouddriverServer = new MockWebServer();
clouddriverServer.start(7002);

Dispatcher clouddriverDispatcher =
new Dispatcher() {
@Override
Expand All @@ -71,6 +75,9 @@ public MockResponse dispatch(RecordedRequest request) {
}
};
front50Server.setDispatcher(front50Dispatcher);

echoServer = new MockWebServer();
echoServer.start(8089);
}

@AfterAll
Expand Down
44 changes: 44 additions & 0 deletions gate-web/src/test/resources/application-echo.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#
# Copyright 2024 Harness, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http=//www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

spring.application.name=gate
services.clouddriver.baseUrl=http://localhost:7002
services.deck.baseUrl=http://localhost:9000

services.echo.enabled=true
services.echo.baseUrl=http://localhost:8089

services.fiat.enabled=false

services.fiat.baseUrl=http://localhost:8082

services.front50.baseUrl=http://localhost:8081

services.igor.enabled=false

services.kayenta.enabled=false


services.orca.baseUrl=http://localhost:8083

services.mine.enabled=false

services.swabbie.enabled=false
services.keel.enabled=false
services.keel.baseUrl=http://localhost:8087

retrofit.enabled=true
healthCheckableServices=igor
77 changes: 0 additions & 77 deletions gate-web/src/test/resources/gate-echo.yml

This file was deleted.

0 comments on commit 7d98f02

Please sign in to comment.