From 418663da5b6de8fb719171b97b456cecfb7d44b4 Mon Sep 17 00:00:00 2001 From: Angel Baro Date: Thu, 7 Mar 2024 16:31:21 +0100 Subject: [PATCH 1/8] Scenario creating new location2 --- .../resources/features/CreateLocation.feature | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/test/resources/features/CreateLocation.feature diff --git a/src/test/resources/features/CreateLocation.feature b/src/test/resources/features/CreateLocation.feature new file mode 100644 index 0000000..c21e7cb --- /dev/null +++ b/src/test/resources/features/CreateLocation.feature @@ -0,0 +1,18 @@ +Feature: Create Location + In order to efficiently manage locations + I want to be able to create a new Location record in the system + + Background: + Given There is a registered user with username "username" and password "password" and email "user@domain.com" + + Scenario: Create a new Location with valid address, latitude, longitude, province, city, and postal code + Given I can login with username "username" and password "password" + When I create a new Location with the following details: + | address | Major Street 3 | + | latitude | 40.7128 | + | longitude | -74.0060 | + | province | Lleida | + | city | Seròs | + | postalCode | 25183 | + Then The response code is 201 + And There is 1 Location created \ No newline at end of file From 6546b33d83d614d265a2e97772105ea2b6b6b9f9 Mon Sep 17 00:00:00 2001 From: Angel Baro Date: Thu, 7 Mar 2024 16:32:08 +0100 Subject: [PATCH 2/8] Scenario add an already existing location --- .../resources/features/CreateLocation.feature | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/test/resources/features/CreateLocation.feature b/src/test/resources/features/CreateLocation.feature index c21e7cb..695fb4a 100644 --- a/src/test/resources/features/CreateLocation.feature +++ b/src/test/resources/features/CreateLocation.feature @@ -15,4 +15,21 @@ Feature: Create Location | city | Seròs | | postalCode | 25183 | Then The response code is 201 - And There is 1 Location created \ No newline at end of file + And There is 1 Location created + + Scenario: Create a Location with an existing address, city, province, and postal code + Given I can login with username "username" and password "password" + And There is already a Location with the following details: + | address | Major Street 3 | + | city | Seròs | + | province | Lleida | + | postalCode | 25183 | + When I attempt to create a new Location with the following details: + | address | Major Street 3 | + | latitude | 41.6167 | + | longitude | 0.6222 | + | province | Lleida | + | city | Seròs | + | postalCode | 25183 | + Then The response code is 409 + And There is 0 Location created From c241df88506871be0118606f86e8a6a98c57f21a Mon Sep 17 00:00:00 2001 From: Angel Baro Date: Thu, 7 Mar 2024 16:32:55 +0100 Subject: [PATCH 3/8] Scenario trying to create a location with some files blank and null --- src/test/resources/features/CreateLocation.feature | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/test/resources/features/CreateLocation.feature b/src/test/resources/features/CreateLocation.feature index 695fb4a..2eb1950 100644 --- a/src/test/resources/features/CreateLocation.feature +++ b/src/test/resources/features/CreateLocation.feature @@ -33,3 +33,15 @@ Feature: Create Location | postalCode | 25183 | Then The response code is 409 And There is 0 Location created + + Scenario: Attempt to create a Location with address blank and latitude null + Given I can login with username "username" and password "password" + When I create a new Location with the following details: + | address | | + | latitude | null | + | longitude | -74.0060 | + | province | Lleida | + | city | Seròs | + | postalCode | 25183 | + Then The response code is 400 + And There is 0 Location created From 991f09fe8001798df0dce3d1665993ecae13ab2a Mon Sep 17 00:00:00 2001 From: Angel Baro Date: Thu, 7 Mar 2024 16:33:31 +0100 Subject: [PATCH 4/8] Scenario: trying to create a location without being logged in --- src/test/resources/features/CreateLocation.feature | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/test/resources/features/CreateLocation.feature b/src/test/resources/features/CreateLocation.feature index 2eb1950..c1c9cc0 100644 --- a/src/test/resources/features/CreateLocation.feature +++ b/src/test/resources/features/CreateLocation.feature @@ -45,3 +45,15 @@ Feature: Create Location | postalCode | 25183 | Then The response code is 400 And There is 0 Location created + + Scenario: Attempt to create a Location without being logged in + Given I'm not logged in + When I create a new Location with the following details: + | address | Major Street 3 | + | latitude | 40.7128 | + | longitude | -74.0060 | + | province | Lleida | + | city | Seròs | + | postalCode | 25183 | + Then The response code is 401 + And There is 0 Location created \ No newline at end of file From d9f898b6992884c5ff2bfb242dd4191d769655e0 Mon Sep 17 00:00:00 2001 From: Angel Baro Date: Thu, 7 Mar 2024 16:35:06 +0100 Subject: [PATCH 5/8] Added steps for creating a new location --- .../demo/steps/CreateLocationStepsDefs.java | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 src/test/java/cat/udl/eps/softarch/demo/steps/CreateLocationStepsDefs.java diff --git a/src/test/java/cat/udl/eps/softarch/demo/steps/CreateLocationStepsDefs.java b/src/test/java/cat/udl/eps/softarch/demo/steps/CreateLocationStepsDefs.java new file mode 100644 index 0000000..30ea587 --- /dev/null +++ b/src/test/java/cat/udl/eps/softarch/demo/steps/CreateLocationStepsDefs.java @@ -0,0 +1,55 @@ +package cat.udl.eps.softarch.demo.steps; + +import cat.udl.eps.softarch.demo.domain.Location; +import cat.udl.eps.softarch.demo.repository.LocationRepository; +import io.cucumber.java.en.And; +import io.cucumber.java.en.When; +import org.junit.Assert; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; + +import java.nio.charset.StandardCharsets; +import java.util.Map; + +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; +import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; + +public class CreateLocationStepsDefs { + + @Autowired + private StepDefs stepDefs; + + @Autowired + private LocationRepository locationRepository; + + public static String newResourceUri; + + @When("I create a new Location with the following details:$") + public void iCreateANewSeedWithScientificNameAndCommonName(Map locationDetails) throws Throwable { + Location location = new Location(); + location.setAddress(locationDetails.get("address")); + location.setLatitude(Float.parseFloat(locationDetails.get("latitude"))); + location.setLongitude(Float.parseFloat(locationDetails.get("longitude"))); + location.setProvince(locationDetails.get("province")); + location.setCity(locationDetails.get("city")); + location.setPostalCode(Integer.parseInt(locationDetails.get("postalCode"))); + + stepDefs.result = stepDefs.mockMvc.perform( + post("/locations") + .contentType(MediaType.APPLICATION_JSON) + .content(stepDefs.mapper.writeValueAsString(location)) + .characterEncoding(StandardCharsets.UTF_8) + .accept(MediaType.APPLICATION_JSON) + .with(AuthenticationStepDefs.authenticate())) + .andDo(print()); + newResourceUri = stepDefs.result.andReturn().getResponse().getHeader("Location"); + } + + @And("There is (\\d+) Location created$") + public void thereIsLocationCreated(int locationCreatedNum) { + Assert.assertEquals(locationCreatedNum, locationRepository.count()); + } + + + +} From 5b1486c002ba1f408ee608a54be254adb2bfe20c Mon Sep 17 00:00:00 2001 From: Angel Baro Date: Thu, 4 Apr 2024 16:02:01 +0200 Subject: [PATCH 6/8] Added the scenarios/features and the implmeentation of them --- .../eps/softarch/demo/domain/Location.java | 4 +- .../demo/repository/LocationRepository.java | 8 +- .../demo/steps/CreateLocationStepsDefs.java | 73 +++++++++++++++---- .../resources/features/CreateLocation.feature | 29 ++++++-- 4 files changed, 88 insertions(+), 26 deletions(-) diff --git a/src/main/java/cat/udl/eps/softarch/demo/domain/Location.java b/src/main/java/cat/udl/eps/softarch/demo/domain/Location.java index d515f78..670f41b 100644 --- a/src/main/java/cat/udl/eps/softarch/demo/domain/Location.java +++ b/src/main/java/cat/udl/eps/softarch/demo/domain/Location.java @@ -13,7 +13,7 @@ @EqualsAndHashCode(callSuper = false) public class Location { @OneToOne - @NotNull + /*@NotNull*/ @JsonIdentityReference(alwaysAsId = true) private Shelter shelter; @@ -24,10 +24,8 @@ public class Location { @NotBlank private String address; - @NotNull private Float latitude; - @NotNull private Float longitude; @NotBlank diff --git a/src/main/java/cat/udl/eps/softarch/demo/repository/LocationRepository.java b/src/main/java/cat/udl/eps/softarch/demo/repository/LocationRepository.java index e705bd3..d48452f 100644 --- a/src/main/java/cat/udl/eps/softarch/demo/repository/LocationRepository.java +++ b/src/main/java/cat/udl/eps/softarch/demo/repository/LocationRepository.java @@ -4,10 +4,14 @@ import cat.udl.eps.softarch.demo.domain.User; import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.PagingAndSortingRepository; +import org.springframework.data.repository.query.Param; import org.springframework.data.rest.core.annotation.RepositoryRestResource; +import java.util.List; +import java.util.Optional; + @RepositoryRestResource public interface LocationRepository extends CrudRepository, PagingAndSortingRepository { + Location findLocationByAddressAndProvinceAndCityAndPostalCode(@Param("address") String address, @Param("province") String province, @Param("city") String city, @Param("postalCode") Integer postalCode); - -} +} \ No newline at end of file diff --git a/src/test/java/cat/udl/eps/softarch/demo/steps/CreateLocationStepsDefs.java b/src/test/java/cat/udl/eps/softarch/demo/steps/CreateLocationStepsDefs.java index 30ea587..f3adaf9 100644 --- a/src/test/java/cat/udl/eps/softarch/demo/steps/CreateLocationStepsDefs.java +++ b/src/test/java/cat/udl/eps/softarch/demo/steps/CreateLocationStepsDefs.java @@ -6,14 +6,25 @@ import io.cucumber.java.en.When; import org.junit.Assert; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.server.ResponseStatusException; +import org.springframework.web.servlet.support.ServletUriComponentsBuilder; +import java.net.URI; import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; import java.util.Map; +import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; + public class CreateLocationStepsDefs { @Autowired @@ -24,32 +35,68 @@ public class CreateLocationStepsDefs { public static String newResourceUri; - @When("I create a new Location with the following details:$") - public void iCreateANewSeedWithScientificNameAndCommonName(Map locationDetails) throws Throwable { + @When("There is already a Location with the following details:$") + public void thereIsAlreadyALocationWithTheFollowingDetails(Map locationDetails) throws Throwable{ Location location = new Location(); location.setAddress(locationDetails.get("address")); - location.setLatitude(Float.parseFloat(locationDetails.get("latitude"))); - location.setLongitude(Float.parseFloat(locationDetails.get("longitude"))); location.setProvince(locationDetails.get("province")); location.setCity(locationDetails.get("city")); location.setPostalCode(Integer.parseInt(locationDetails.get("postalCode"))); + locationRepository.save(location); + } + @When("I create a new Location with the following details:$") + public void iCreateANewLocationWithTheFollowingDetails(Map locationDetails) throws Throwable { + Location existingLocation = locationRepository.findLocationByAddressAndProvinceAndCityAndPostalCode( + locationDetails.get("address"), + locationDetails.get("province"), + locationDetails.get("city"), + Integer.parseInt(locationDetails.get("postalCode")) + ); + + if (existingLocation == null) { + + Location location = new Location(); + location.setAddress(locationDetails.get("address")); + location.setProvince(locationDetails.get("province")); + location.setCity(locationDetails.get("city")); + location.setPostalCode(Integer.parseInt(locationDetails.get("postalCode"))); + + // Verify and assign latitude and longitude if exists + if (locationDetails.containsKey("longitude") && locationDetails.get("longitude") != null) { + location.setLongitude(Float.parseFloat(locationDetails.get("longitude"))); + } - stepDefs.result = stepDefs.mockMvc.perform( - post("/locations") - .contentType(MediaType.APPLICATION_JSON) - .content(stepDefs.mapper.writeValueAsString(location)) - .characterEncoding(StandardCharsets.UTF_8) - .accept(MediaType.APPLICATION_JSON) - .with(AuthenticationStepDefs.authenticate())) - .andDo(print()); - newResourceUri = stepDefs.result.andReturn().getResponse().getHeader("Location"); + + if (locationDetails.containsKey("latitude") && locationDetails.get("latitude") != null) { + location.setLatitude(Float.parseFloat(locationDetails.get("latitude"))); + } + + stepDefs.result = stepDefs.mockMvc.perform( + post("/locations") + .contentType(MediaType.APPLICATION_JSON) + .content(stepDefs.mapper.writeValueAsString(location)) + .characterEncoding(StandardCharsets.UTF_8) + .accept(MediaType.APPLICATION_JSON) + .with(AuthenticationStepDefs.authenticate())) + .andDo(print()); + newResourceUri = stepDefs.result.andReturn().getResponse().getHeader("Location"); + + } else { + assertThat(existingLocation).isNotNull(); + } } + + @And("There is (\\d+) Location created$") public void thereIsLocationCreated(int locationCreatedNum) { Assert.assertEquals(locationCreatedNum, locationRepository.count()); } + @And("There is only (\\d+) Location with the details:$") + public void thereIsOnlyLocationWithTheDeatils(int locationCreatedNum, Map locationDetails) { + Assert.assertEquals(locationCreatedNum, locationRepository.count()); + } } diff --git a/src/test/resources/features/CreateLocation.feature b/src/test/resources/features/CreateLocation.feature index c1c9cc0..f498fca 100644 --- a/src/test/resources/features/CreateLocation.feature +++ b/src/test/resources/features/CreateLocation.feature @@ -20,25 +20,28 @@ Feature: Create Location Scenario: Create a Location with an existing address, city, province, and postal code Given I can login with username "username" and password "password" And There is already a Location with the following details: - | address | Major Street 3 | - | city | Seròs | - | province | Lleida | - | postalCode | 25183 | - When I attempt to create a new Location with the following details: + | address | Major Street 3 | + | province | Lleida | + | city | Seròs | + | postalCode | 25183 | + When I create a new Location with the following details: | address | Major Street 3 | | latitude | 41.6167 | | longitude | 0.6222 | | province | Lleida | | city | Seròs | | postalCode | 25183 | - Then The response code is 409 - And There is 0 Location created + Then The response code is 200 + And There is only 1 Location with the details: + | address | Major Street 3 | + | province | Lleida | + | city | Seròs | + | postalCode | 25183 | Scenario: Attempt to create a Location with address blank and latitude null Given I can login with username "username" and password "password" When I create a new Location with the following details: | address | | - | latitude | null | | longitude | -74.0060 | | province | Lleida | | city | Seròs | @@ -46,6 +49,16 @@ Feature: Create Location Then The response code is 400 And There is 0 Location created + Scenario: Attempt to create a Location with longitude null and latitude null + Given I can login with username "username" and password "password" + When I create a new Location with the following details: + | address | Major Street 3 | + | province | Lleida | + | city | Seròs | + | postalCode | 25183 | + Then The response code is 201 + And There is 1 Location created + Scenario: Attempt to create a Location without being logged in Given I'm not logged in When I create a new Location with the following details: From d3b0fca60fd014ef5b9ba0b15ff04b2f8e89f5c8 Mon Sep 17 00:00:00 2001 From: Angel Baro Date: Thu, 4 Apr 2024 16:33:58 +0200 Subject: [PATCH 7/8] Added the Location features for getting an existing and non-existing location --- .../demo/steps/GetLocationStepsDefs.java | 58 +++++++++++++++++++ .../resources/features/GetLocation.feature | 31 ++++++++++ 2 files changed, 89 insertions(+) create mode 100644 src/test/java/cat/udl/eps/softarch/demo/steps/GetLocationStepsDefs.java create mode 100644 src/test/resources/features/GetLocation.feature diff --git a/src/test/java/cat/udl/eps/softarch/demo/steps/GetLocationStepsDefs.java b/src/test/java/cat/udl/eps/softarch/demo/steps/GetLocationStepsDefs.java new file mode 100644 index 0000000..5f098a0 --- /dev/null +++ b/src/test/java/cat/udl/eps/softarch/demo/steps/GetLocationStepsDefs.java @@ -0,0 +1,58 @@ +package cat.udl.eps.softarch.demo.steps; + + +import cat.udl.eps.softarch.demo.domain.Location; +import cat.udl.eps.softarch.demo.repository.LocationRepository; +import io.cucumber.java.en.And; +import io.cucumber.java.en.When; +import org.junit.Assert; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.server.ResponseStatusException; +import org.springframework.web.servlet.support.ServletUriComponentsBuilder; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; + +import java.net.URI; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; +import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; + + +public class GetLocationStepsDefs { + + @Autowired + private StepDefs stepDefs; + + @Autowired + private LocationRepository locationRepository; + + public static String newResourceUri; + @When("I retrieve the location with the details:$") + public void iRetrieveTheLocationWithTheDetails(Map locationDetails) throws Throwable{ + Location existingLocation = locationRepository.findLocationByAddressAndProvinceAndCityAndPostalCode( + locationDetails.get("address"), + locationDetails.get("province"), + locationDetails.get("city"), + Integer.parseInt(locationDetails.get("postalCode")) + ); + + stepDefs.result = stepDefs.mockMvc.perform( + get("/locations/{id}", (existingLocation != null) ? existingLocation.getId() : "999") + .contentType(MediaType.APPLICATION_JSON) + .content(stepDefs.mapper.writeValueAsString(existingLocation)) + .characterEncoding(StandardCharsets.UTF_8) + .accept(MediaType.APPLICATION_JSON) + .with(AuthenticationStepDefs.authenticate())) + .andDo(print()); + } + +} diff --git a/src/test/resources/features/GetLocation.feature b/src/test/resources/features/GetLocation.feature new file mode 100644 index 0000000..6e2e3d4 --- /dev/null +++ b/src/test/resources/features/GetLocation.feature @@ -0,0 +1,31 @@ +Feature: Get Location + In order to retrieve Location information + As a user with appropriate permissions + I want to be able to get the Location details of a shelter + + Background: + Given There is a registered user with username "username" and password "password" and email "user@email.com" + + + Scenario: Get an existing Location details + Given I can login with username "username" and password "password" + And There is already a Location with the following details: + | address | Major Street 3 | + | province | Lleida | + | city | Seròs | + | postalCode | 25183 | + When I retrieve the location with the details: + | address | Major Street 3 | + | province | Lleida | + | city | Seròs | + | postalCode | 25183 | + Then The response code is 200 + + Scenario: Get a non-existent Location details + Given I can login with username "username" and password "password" + When I retrieve the location with the details: + | address | Major Street 3 | + | province | Lleida | + | city | Seròs | + | postalCode | 25183 | + Then The response code is 404 From a82b1cec82b1a4c2b0e8f269e3c09a150bb2fb52 Mon Sep 17 00:00:00 2001 From: Angel Baro Date: Thu, 4 Apr 2024 16:47:00 +0200 Subject: [PATCH 8/8] Location feature of deleting --- .../demo/steps/DeleteLocationStepsDefs.java | 63 +++++++++++++++++++ .../resources/features/DeleteLocation.feature | 41 ++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 src/test/java/cat/udl/eps/softarch/demo/steps/DeleteLocationStepsDefs.java create mode 100644 src/test/resources/features/DeleteLocation.feature diff --git a/src/test/java/cat/udl/eps/softarch/demo/steps/DeleteLocationStepsDefs.java b/src/test/java/cat/udl/eps/softarch/demo/steps/DeleteLocationStepsDefs.java new file mode 100644 index 0000000..7b02fd4 --- /dev/null +++ b/src/test/java/cat/udl/eps/softarch/demo/steps/DeleteLocationStepsDefs.java @@ -0,0 +1,63 @@ +package cat.udl.eps.softarch.demo.steps; + + +import cat.udl.eps.softarch.demo.domain.Location; +import cat.udl.eps.softarch.demo.repository.LocationRepository; +import io.cucumber.java.en.And; +import io.cucumber.java.en.When; +import org.junit.Assert; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.server.ResponseStatusException; +import org.springframework.web.servlet.support.ServletUriComponentsBuilder; + +import java.net.URI; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; +import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; + + +public class DeleteLocationStepsDefs { + + @Autowired + private StepDefs stepDefs; + + @Autowired + private LocationRepository locationRepository; + + public static String newResourceUri; + @When("I delete the location with the details:$") + public void iDeleteTheLocationWithTheDetails(Map locationDetails) throws Throwable{ + Location existingLocation = locationRepository.findLocationByAddressAndProvinceAndCityAndPostalCode( + locationDetails.get("address"), + locationDetails.get("province"), + locationDetails.get("city"), + Integer.parseInt(locationDetails.get("postalCode")) + ); + + stepDefs.result = stepDefs.mockMvc.perform( + delete("/locations/{id}", (existingLocation != null) ? existingLocation.getId() : "999") + .contentType(MediaType.APPLICATION_JSON) + .content(stepDefs.mapper.writeValueAsString(existingLocation)) + .characterEncoding(StandardCharsets.UTF_8) + .accept(MediaType.APPLICATION_JSON) + .with(AuthenticationStepDefs.authenticate())) + .andDo(print()); + } + + @And("There is (\\d+) Location with the details:$") + public void thereIsOnlyLocationWithTheDeatils(int locationNum, Map locationDetails) { + Assert.assertEquals(locationNum, locationRepository.count()); + } + + +} diff --git a/src/test/resources/features/DeleteLocation.feature b/src/test/resources/features/DeleteLocation.feature new file mode 100644 index 0000000..783782b --- /dev/null +++ b/src/test/resources/features/DeleteLocation.feature @@ -0,0 +1,41 @@ +Feature: Delete Location + In order to delete an existing Location + As a user with appropriate permissions + I want to be able to delete the Location details of a shelter + + Background: + Given There is a registered user with username "username" and password "password" and email "user@email.com" + And There is already a Location with the following details: + | address | Major Street 3 | + | province | Lleida | + | city | Seròs | + | postalCode | 25183 | + + + Scenario: Delete an existing Location details + Given I can login with username "username" and password "password" + When I delete the location with the details: + | address | Major Street 3 | + | province | Lleida | + | city | Seròs | + | postalCode | 25183 | + Then The response code is 200 + And There is 0 Location with the details: + | address | Major Street 3 | + | province | Lleida | + | city | Seròs | + | postalCode | 25183 | + + Scenario: Delete Location when I am not logged in + Given I'm not logged in + When I delete the location with the details: + | address | Major Street 3 | + | province | Lleida | + | city | Seròs | + | postalCode | 25183 | + Then The response code is 401 + And There is 1 Location with the details: + | address | Major Street 3 | + | province | Lleida | + | city | Seròs | + | postalCode | 25183 | \ No newline at end of file