rearranged packages to include service and secondservice into gateway customfilters package, as they belong to that article
This commit is contained in:
+2
-2
@@ -1,4 +1,4 @@
|
||||
package com.baeldung.springcloudgateway.customfilters;
|
||||
package com.baeldung.springcloudgateway.customfilters.gatewayapp;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.springframework.boot.web.server.LocalServerPort;
|
||||
import org.springframework.test.web.reactive.server.WebTestClient;
|
||||
import org.springframework.test.web.reactive.server.WebTestClient.ResponseSpec;
|
||||
|
||||
import com.baeldung.springcloudgateway.customfilters.utils.LoggerListAppender;
|
||||
import com.baeldung.springcloudgateway.customfilters.gatewayapp.utils.LoggerListAppender;
|
||||
|
||||
import ch.qos.logback.classic.spi.ILoggingEvent;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.baeldung.springcloudgateway.customfilters.utils;
|
||||
package com.baeldung.springcloudgateway.customfilters.gatewayapp.utils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package com.baeldung.springcloudgateway.customfilters.secondservice;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest;
|
||||
import org.springframework.test.web.reactive.server.WebTestClient;
|
||||
|
||||
import com.baeldung.springcloudgateway.customfilters.secondservice.web.SecondServiceRestController;
|
||||
|
||||
@WebFluxTest(SecondServiceRestController.class)
|
||||
public class SecondServiceIntegrationTest {
|
||||
|
||||
@Autowired
|
||||
private WebTestClient webClient;
|
||||
|
||||
@Test
|
||||
public void whenResourceLanguageEndpointCalled_thenRetrievesSpanishLanguageString() throws Exception {
|
||||
this.webClient.get()
|
||||
.uri("/resource/language")
|
||||
.exchange()
|
||||
.expectStatus()
|
||||
.isOk()
|
||||
.expectBody(String.class)
|
||||
.isEqualTo("es");
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.baeldung.springcloudgateway.customfilters.secondservice;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
@SpringBootTest(classes = SecondServiceApplication.class)
|
||||
public class SpringContextTest {
|
||||
|
||||
@Test
|
||||
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.baeldung.springcloudgateway.customfilters.service;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.test.web.reactive.server.WebTestClient;
|
||||
|
||||
import com.baeldung.springcloudgateway.customfilters.service.web.ServiceRestController;
|
||||
|
||||
@WebFluxTest(ServiceRestController.class)
|
||||
public class ServiceIntegrationTest {
|
||||
|
||||
@Autowired
|
||||
private WebTestClient webClient;
|
||||
|
||||
@Test
|
||||
public void whenResourceEndpointCalled_thenRetrievesResourceStringWithContentLanguageHeader() throws Exception {
|
||||
this.webClient.get()
|
||||
.uri("/resource")
|
||||
.exchange()
|
||||
.expectStatus()
|
||||
.isOk()
|
||||
.expectHeader()
|
||||
.valueEquals(HttpHeaders.CONTENT_LANGUAGE, "en")
|
||||
.expectBody(String.class)
|
||||
.isEqualTo("Service Resource");
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.baeldung.springcloudgateway.customfilters.service;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
@SpringBootTest(classes = ServiceApplication.class)
|
||||
public class SpringContextTest {
|
||||
|
||||
@Test
|
||||
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user