diff --git a/java-spring/accounts-command-side-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/AccountsCommandSideServiceIntegrationTest.java b/java-spring/accounts-command-side-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/AccountsCommandSideServiceIntegrationTest.java index 29ffb9e..c015229 100644 --- a/java-spring/accounts-command-side-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/AccountsCommandSideServiceIntegrationTest.java +++ b/java-spring/accounts-command-side-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/AccountsCommandSideServiceIntegrationTest.java @@ -25,7 +25,7 @@ public class AccountsCommandSideServiceIntegrationTest { private int port; private String baseUrl(String path) { - return "http://localhost:" + port + "/" + path; + return "http://localhost:" + port + "/api" + path; } @Autowired diff --git a/java-spring/accounts-command-side-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/web/commandside/accounts/AccountController.java b/java-spring/accounts-command-side-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/web/commandside/accounts/AccountController.java index f908622..c2c6dbe 100644 --- a/java-spring/accounts-command-side-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/web/commandside/accounts/AccountController.java +++ b/java-spring/accounts-command-side-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/web/commandside/accounts/AccountController.java @@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RestController; import java.util.concurrent.CompletableFuture; @RestController -@RequestMapping("/accounts") +@RequestMapping("/api/accounts") public class AccountController { private AccountService accountService; diff --git a/java-spring/accounts-command-side-web/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/commandside/accounts/AccountControllerIntegrationTest.java b/java-spring/accounts-command-side-web/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/commandside/accounts/AccountControllerIntegrationTest.java index 593b1ea..e1be1e1 100644 --- a/java-spring/accounts-command-side-web/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/commandside/accounts/AccountControllerIntegrationTest.java +++ b/java-spring/accounts-command-side-web/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/commandside/accounts/AccountControllerIntegrationTest.java @@ -35,7 +35,7 @@ public class AccountControllerIntegrationTest { @Test public void shouldCreateAccount() throws Exception { - mockMvc.perform(post("/accounts") + mockMvc.perform(post("/api/accounts") .contentType(MediaType.APPLICATION_JSON) .content("{\"customerId\" : \"00000000-00000000\", \"initialBalance\" : 500}") .accept(MediaType.APPLICATION_JSON)) @@ -44,7 +44,7 @@ public class AccountControllerIntegrationTest { @Test public void shouldRejectBadRequest() throws Exception { - mockMvc.perform(post("/accounts") + mockMvc.perform(post("/api/accounts") .contentType(MediaType.APPLICATION_JSON) .content("{\"initialBalanceXXX\" : 500}") .accept(MediaType.APPLICATION_JSON)) diff --git a/java-spring/accounts-query-side-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/AccountsQuerySideServiceIntegrationTest.java b/java-spring/accounts-query-side-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/AccountsQuerySideServiceIntegrationTest.java index dab85cd..663888e 100644 --- a/java-spring/accounts-query-side-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/AccountsQuerySideServiceIntegrationTest.java +++ b/java-spring/accounts-query-side-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/AccountsQuerySideServiceIntegrationTest.java @@ -30,7 +30,7 @@ public class AccountsQuerySideServiceIntegrationTest { private int port; private String baseUrl(String path) { - return "http://localhost:" + port + "/" + path; + return "http://localhost:" + port + "/api" + path; } @Autowired diff --git a/java-spring/accounts-query-side-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/web/queryside/accounts/AccountQueryController.java b/java-spring/accounts-query-side-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/web/queryside/accounts/AccountQueryController.java index 9609985..934ae3a 100644 --- a/java-spring/accounts-query-side-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/web/queryside/accounts/AccountQueryController.java +++ b/java-spring/accounts-query-side-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/web/queryside/accounts/AccountQueryController.java @@ -17,6 +17,7 @@ import java.util.List; import java.util.stream.Collectors; @RestController +@RequestMapping("/api") public class AccountQueryController { private AccountQueryService accountInfoQueryService; diff --git a/java-spring/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/controller/GatewayController.java b/java-spring/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/controller/GatewayController.java index 4cb2ccb..a9224e0 100755 --- a/java-spring/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/controller/GatewayController.java +++ b/java-spring/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/controller/GatewayController.java @@ -56,7 +56,7 @@ public class GatewayController { .build(); } - @RequestMapping(value = {"/accounts**","/customers**","/transfers**","/login","/user"}, method = {GET, POST}) + @RequestMapping(value = "/api/**", method = {GET, POST}) public ResponseEntity proxyRequest(HttpServletRequest request) throws NoSuchRequestHandlingMethodException, IOException, URISyntaxException { HttpUriRequest proxiedRequest = createHttpUriRequest(request); logger.info("request: {}", proxiedRequest); diff --git a/java-spring/common-auth-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/controller/AuthController.java b/java-spring/common-auth-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/controller/AuthController.java index c86f4f5..59143b9 100644 --- a/java-spring/common-auth-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/controller/AuthController.java +++ b/java-spring/common-auth-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/controller/AuthController.java @@ -28,6 +28,7 @@ import static org.springframework.web.bind.annotation.RequestMethod.POST; */ @RestController @Validated +@RequestMapping("/api") public class AuthController { @Autowired diff --git a/java-spring/common-auth/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/AuthConfiguration.java b/java-spring/common-auth/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/AuthConfiguration.java index ea6fcac..df5e1cd 100755 --- a/java-spring/common-auth/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/AuthConfiguration.java +++ b/java-spring/common-auth/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/AuthConfiguration.java @@ -80,7 +80,7 @@ public class AuthConfiguration extends WebSecurityConfigurerAdapter { .authorizeRequests() .antMatchers("/index.html", "/", "/**.js", "/**.css").permitAll() .antMatchers("/swagger-ui.html", "/v2/api-docs").permitAll() - .antMatchers(HttpMethod.POST, "/customers", "/login").permitAll() + .antMatchers(HttpMethod.POST, "/api/customers", "/api/login").permitAll() .anyRequest().authenticated().and() .addFilterAfter(new StatelessAuthenticationFilter(tokenAuthenticationService), BasicAuthenticationFilter.class); } diff --git a/java-spring/customers-command-side-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/CustomersCommandSideServiceIntegrationTest.java b/java-spring/customers-command-side-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/CustomersCommandSideServiceIntegrationTest.java index 2062000..670462f 100644 --- a/java-spring/customers-command-side-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/CustomersCommandSideServiceIntegrationTest.java +++ b/java-spring/customers-command-side-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/CustomersCommandSideServiceIntegrationTest.java @@ -25,7 +25,7 @@ public class CustomersCommandSideServiceIntegrationTest { private int port; private String baseUrl(String path) { - return "http://localhost:" + port + "/" + path; + return "http://localhost:" + port + "/api" + path; } @Autowired diff --git a/java-spring/customers-command-side-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/web/commandside/customers/CustomerController.java b/java-spring/customers-command-side-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/web/commandside/customers/CustomerController.java index 5da5cee..14ff012 100644 --- a/java-spring/customers-command-side-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/web/commandside/customers/CustomerController.java +++ b/java-spring/customers-command-side-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/web/commandside/customers/CustomerController.java @@ -15,7 +15,7 @@ import java.util.concurrent.CompletableFuture; * Created by popikyardo on 03.02.16. */ @RestController -@RequestMapping("/customers") +@RequestMapping("/api/customers") public class CustomerController { private CustomerService customerService; diff --git a/java-spring/customers-query-side-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/CustomersQuerySideServiceIntegrationTest.java b/java-spring/customers-query-side-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/CustomersQuerySideServiceIntegrationTest.java index badb967..f48c868 100644 --- a/java-spring/customers-query-side-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/CustomersQuerySideServiceIntegrationTest.java +++ b/java-spring/customers-query-side-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/CustomersQuerySideServiceIntegrationTest.java @@ -27,7 +27,7 @@ public class CustomersQuerySideServiceIntegrationTest { private int port; private String baseUrl(String path) { - return "http://localhost:" + port + "/" + path; + return "http://localhost:" + port + "/api" + path; } @Autowired diff --git a/java-spring/customers-query-side-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/web/customers/queryside/CustomerQueryController.java b/java-spring/customers-query-side-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/web/customers/queryside/CustomerQueryController.java index a78d857..95b347c 100644 --- a/java-spring/customers-query-side-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/web/customers/queryside/CustomerQueryController.java +++ b/java-spring/customers-query-side-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/web/customers/queryside/CustomerQueryController.java @@ -14,6 +14,7 @@ import java.util.concurrent.CompletableFuture; * Created by Main on 05.02.2016. */ @RestController +@RequestMapping("/api") public class CustomerQueryController { private CustomerQueryService customerQueryService; diff --git a/java-spring/e2e-test/src/test/java/net/chrisrichardson/eventstore/examples/bank/web/EndToEndTest.java b/java-spring/e2e-test/src/test/java/net/chrisrichardson/eventstore/examples/bank/web/EndToEndTest.java index 29684ab..7f9f293 100644 --- a/java-spring/e2e-test/src/test/java/net/chrisrichardson/eventstore/examples/bank/web/EndToEndTest.java +++ b/java-spring/e2e-test/src/test/java/net/chrisrichardson/eventstore/examples/bank/web/EndToEndTest.java @@ -18,7 +18,7 @@ public class EndToEndTest extends AbstractRestAPITest { CustomersTestUtils customersTestUtils = new CustomersTestUtils(restTemplate, baseUrl("/customers/")); public String baseUrl(String path) { - return "http://" + getenv("SERVICE_HOST", "localhost") + ":" + 8080 + "/" + path; + return "http://" + getenv("SERVICE_HOST", "localhost") + ":" + 8080 + "/api" + path; } @Override diff --git a/java-spring/monolithic-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/BankingAuthTest.java b/java-spring/monolithic-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/BankingAuthTest.java index 173f31d..2499229 100644 --- a/java-spring/monolithic-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/BankingAuthTest.java +++ b/java-spring/monolithic-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/BankingAuthTest.java @@ -43,7 +43,7 @@ public class BankingAuthTest { } private String baseUrl(String path) { - return "http://localhost:" + port + "/" + path; + return "http://localhost:" + port + "/api" + path; } @Test diff --git a/java-spring/monolithic-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/BankingWebIntegrationTest.java b/java-spring/monolithic-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/BankingWebIntegrationTest.java index f07ac9d..745e2b4 100644 --- a/java-spring/monolithic-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/BankingWebIntegrationTest.java +++ b/java-spring/monolithic-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/BankingWebIntegrationTest.java @@ -32,7 +32,7 @@ public class BankingWebIntegrationTest extends AbstractRestAPITest { @Override public String baseUrl(String path) { - return "http://localhost:" + port + "/" + path; + return "http://localhost:" + port + "/api" + path; } @Override diff --git a/java-spring/transactions-command-side-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/TransactionsCommandSideServiceIntegrationTest.java b/java-spring/transactions-command-side-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/TransactionsCommandSideServiceIntegrationTest.java index 0ec3a77..8d82dfd 100644 --- a/java-spring/transactions-command-side-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/TransactionsCommandSideServiceIntegrationTest.java +++ b/java-spring/transactions-command-side-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/TransactionsCommandSideServiceIntegrationTest.java @@ -20,7 +20,7 @@ public class TransactionsCommandSideServiceIntegrationTest { private int port; private String baseUrl(String path) { - return "http://localhost:" + port + "/" + path; + return "http://localhost:" + port + "/api" + path; } @Autowired diff --git a/java-spring/transactions-command-side-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/web/commandside/transactions/MoneyTransferController.java b/java-spring/transactions-command-side-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/web/commandside/transactions/MoneyTransferController.java index 7c5649f..8c8a348 100644 --- a/java-spring/transactions-command-side-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/web/commandside/transactions/MoneyTransferController.java +++ b/java-spring/transactions-command-side-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/web/commandside/transactions/MoneyTransferController.java @@ -16,7 +16,7 @@ import java.util.Date; import java.util.concurrent.CompletableFuture; @RestController -@RequestMapping("/transfers") +@RequestMapping("/api/transfers") public class MoneyTransferController { private final MoneyTransferService moneyTransferService; diff --git a/java-spring/transactions-command-side-web/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/commandside/transactions/MoneyTransferControllerIntegrationTest.java b/java-spring/transactions-command-side-web/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/commandside/transactions/MoneyTransferControllerIntegrationTest.java index f49d009..4aa88a7 100644 --- a/java-spring/transactions-command-side-web/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/commandside/transactions/MoneyTransferControllerIntegrationTest.java +++ b/java-spring/transactions-command-side-web/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/commandside/transactions/MoneyTransferControllerIntegrationTest.java @@ -36,7 +36,7 @@ public class MoneyTransferControllerIntegrationTest { @Test public void shouldCreateAccount() throws Exception { - mockMvc.perform(post("/transfers") + mockMvc.perform(post("/api/transfers") .contentType(MediaType.APPLICATION_JSON) .content("{\"fromAccountId\" : \"fromAccountId\", \"toAccountId\" : \"toAccountId\", \"amount\" : \"500\"}") .accept(MediaType.APPLICATION_JSON)) @@ -45,7 +45,7 @@ public class MoneyTransferControllerIntegrationTest { @Test public void shouldRejectBadRequest() throws Exception { - mockMvc.perform(post("/transfers") + mockMvc.perform(post("/api/transfers") .contentType(MediaType.APPLICATION_JSON) .content("{\"fromAccountId\" : \"fromAccountIdXXXXXX\"}, {\"toAccountId\" : \"toAccountId\"}, {\"amount\" : \"500\"}") .accept(MediaType.APPLICATION_JSON))