From bd4e30548eca00da5f1da9bf5a600ebd00f50558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Garc=C3=ADa?= Date: Tue, 28 Nov 2023 17:29:54 +0100 Subject: [PATCH] Add swap to fly.io to avoid out of memory crash --- fly.toml | 2 ++ .../udl/eps/softarch/myroutes/config/DBInitialization.java | 4 ++-- src/test/resources/features/CreateRoute.feature | 2 +- src/test/resources/features/UpdateRoute.feature | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/fly.toml b/fly.toml index 4ba3bbd..cbb0ba6 100644 --- a/fly.toml +++ b/fly.toml @@ -1,5 +1,7 @@ app = "myroutes-api" +swap_size_mb = 512 + # [build] # image = "udlepssoftarch/myroutes-api:latest" diff --git a/src/main/java/cat/udl/eps/softarch/myroutes/config/DBInitialization.java b/src/main/java/cat/udl/eps/softarch/myroutes/config/DBInitialization.java index 3cb3e11..6f7cc30 100644 --- a/src/main/java/cat/udl/eps/softarch/myroutes/config/DBInitialization.java +++ b/src/main/java/cat/udl/eps/softarch/myroutes/config/DBInitialization.java @@ -35,8 +35,8 @@ public void initializeDatabase() { } if (!adminRepository.existsById("root")) { Admin admin = new Admin(); - admin.setEmail("admin@sample.app"); - admin.setId("admin"); + admin.setEmail("root@myroutes.app"); + admin.setId("root"); admin.setPassword(defaultPassword); admin.encodePassword(); adminRepository.save(admin); diff --git a/src/test/resources/features/CreateRoute.feature b/src/test/resources/features/CreateRoute.feature index c531121..4352ab4 100644 --- a/src/test/resources/features/CreateRoute.feature +++ b/src/test/resources/features/CreateRoute.feature @@ -24,7 +24,7 @@ Feature: Create Route Given I login as "admin" with password "password" And I don't have any route When I create a route with a title "testRoute", description "route description", type "Running" and a creationDate "2023-10-25T17:27:00Z" - Then The response code is 403 + Then The response code is 401 Scenario: Create an empty route while logged in Given I login as "user" with password "password" diff --git a/src/test/resources/features/UpdateRoute.feature b/src/test/resources/features/UpdateRoute.feature index 86fb86f..dd84f8e 100644 --- a/src/test/resources/features/UpdateRoute.feature +++ b/src/test/resources/features/UpdateRoute.feature @@ -22,7 +22,7 @@ Feature: Update Route Scenario: Update a route while logged in as admin Given I login as "admin" with password "password" When I update a route with a title "testRoute", description "route description", type "Running" and a creationDate "2023-10-25T17:27:00Z" - Then The response code is 403 + Then The response code is 401 Scenario: Update a route while logged in as reviewer Given I login as "reviewer" with password "password"