diff --git a/src/main/java/eu/sshopencloud/marketplace/conf/auth/WebSecurityConfig.java b/src/main/java/eu/sshopencloud/marketplace/conf/auth/WebSecurityConfig.java index d6909542ce14e65a9d2472308635bfc0dfcc0983..7e5f0d9bc68276e6d7bb48e88e56f29be0bee403 100644 --- a/src/main/java/eu/sshopencloud/marketplace/conf/auth/WebSecurityConfig.java +++ b/src/main/java/eu/sshopencloud/marketplace/conf/auth/WebSecurityConfig.java @@ -267,6 +267,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { firewall.setAllowUrlEncodedSlash(true); firewall.setAllowSemicolon(true); firewall.setAllowUrlEncodedDoubleSlash(true); + firewall.setAllowUrlEncodedPercent(true); return firewall; } diff --git a/src/test/java/eu/sshopencloud/marketplace/controllers/items/ItemControllerITCase.java b/src/test/java/eu/sshopencloud/marketplace/controllers/items/ItemControllerITCase.java index 758c730f7585237781b5e68549c97a9a742a2ade..e8dd15b76d917740692abbf0277a70f10a6f91b7 100644 --- a/src/test/java/eu/sshopencloud/marketplace/controllers/items/ItemControllerITCase.java +++ b/src/test/java/eu/sshopencloud/marketplace/controllers/items/ItemControllerITCase.java @@ -126,35 +126,13 @@ public class ItemControllerITCase { .param("order", "label") .header("Authorization", CONTRIBUTOR_JWT)) .andExpect(status().isOk()) - .andExpect(jsonPath("items", hasSize(14))) + .andExpect(jsonPath("items", hasSize(3))) .andExpect(jsonPath("items[0].persistentId", is("dmbq4v"))) .andExpect(jsonPath("items[0].id", is(9))) - .andExpect(jsonPath("items[1].persistentId", is("prblMo"))) - .andExpect(jsonPath("items[1].id", is(13))) - .andExpect(jsonPath("items[2].persistentId", is("dVZeir"))) - .andExpect(jsonPath("items[2].id", is(15))) - .andExpect(jsonPath("items[3].persistentId", is("2CwYCU"))) - .andExpect(jsonPath("items[3].id", is(14))) - .andExpect(jsonPath("items[4].persistentId", is("tqmbGY"))) - .andExpect(jsonPath("items[4].id", is(12))) - .andExpect(jsonPath("items[5].persistentId", is("gQu2wl"))) - .andExpect(jsonPath("items[5].id", is(24))) - .andExpect(jsonPath("items[6].persistentId", is("EPax9f"))) - .andExpect(jsonPath("items[6].id", is(16))) - .andExpect(jsonPath("items[7].persistentId", is("xYpCdU"))) - .andExpect(jsonPath("items[7].id", is(18))) - .andExpect(jsonPath("items[8].persistentId", is("U8vUos"))) - .andExpect(jsonPath("items[8].id", is(20))) - .andExpect(jsonPath("items[9].persistentId", is("sQY6US"))) - .andExpect(jsonPath("items[9].id", is(23))) - .andExpect(jsonPath("items[10].persistentId", is("HLYtzq"))) - .andExpect(jsonPath("items[10].id", is(17))) - .andExpect(jsonPath("items[11].persistentId", is("BNw43H"))) - .andExpect(jsonPath("items[11].id", is(22))) - .andExpect(jsonPath("items[12].persistentId", is("dU0BZc"))) - .andExpect(jsonPath("items[12].id", is(11))) - .andExpect(jsonPath("items[13].persistentId", is("k68NbF"))) - .andExpect(jsonPath("items[13].id", is(19))); + .andExpect(jsonPath("items[1].persistentId", is("tqmbGY"))) + .andExpect(jsonPath("items[1].id", is(12))) + .andExpect(jsonPath("items[2].persistentId", is("dU0BZc"))) + .andExpect(jsonPath("items[2].id", is(11))); } @@ -166,35 +144,13 @@ public class ItemControllerITCase { .param("order", "label") .header("Authorization", CONTRIBUTOR_JWT)) .andExpect(status().isOk()) - .andExpect(jsonPath("items", hasSize(14))) + .andExpect(jsonPath("items", hasSize(3))) .andExpect(jsonPath("items[0].persistentId", is("dmbq4v"))) .andExpect(jsonPath("items[0].id", is(9))) - .andExpect(jsonPath("items[1].persistentId", is("prblMo"))) - .andExpect(jsonPath("items[1].id", is(13))) - .andExpect(jsonPath("items[2].persistentId", is("dVZeir"))) - .andExpect(jsonPath("items[2].id", is(15))) - .andExpect(jsonPath("items[3].persistentId", is("2CwYCU"))) - .andExpect(jsonPath("items[3].id", is(14))) - .andExpect(jsonPath("items[4].persistentId", is("tqmbGY"))) - .andExpect(jsonPath("items[4].id", is(12))) - .andExpect(jsonPath("items[5].persistentId", is("gQu2wl"))) - .andExpect(jsonPath("items[5].id", is(24))) - .andExpect(jsonPath("items[6].persistentId", is("EPax9f"))) - .andExpect(jsonPath("items[6].id", is(16))) - .andExpect(jsonPath("items[7].persistentId", is("xYpCdU"))) - .andExpect(jsonPath("items[7].id", is(18))) - .andExpect(jsonPath("items[8].persistentId", is("U8vUos"))) - .andExpect(jsonPath("items[8].id", is(20))) - .andExpect(jsonPath("items[9].persistentId", is("sQY6US"))) - .andExpect(jsonPath("items[9].id", is(23))) - .andExpect(jsonPath("items[10].persistentId", is("HLYtzq"))) - .andExpect(jsonPath("items[10].id", is(17))) - .andExpect(jsonPath("items[11].persistentId", is("BNw43H"))) - .andExpect(jsonPath("items[11].id", is(22))) - .andExpect(jsonPath("items[12].persistentId", is("dU0BZc"))) - .andExpect(jsonPath("items[12].id", is(11))) - .andExpect(jsonPath("items[13].persistentId", is("k68NbF"))) - .andExpect(jsonPath("items[13].id", is(19))); + .andExpect(jsonPath("items[1].persistentId", is("tqmbGY"))) + .andExpect(jsonPath("items[1].id", is(12))) + .andExpect(jsonPath("items[2].persistentId", is("dU0BZc"))) + .andExpect(jsonPath("items[2].id", is(11))); DatasetCore dataset = new DatasetCore(); dataset.setLabel("A first"); @@ -226,37 +182,15 @@ public class ItemControllerITCase { .param("order", "label") .header("Authorization", CONTRIBUTOR_JWT)) .andExpect(status().isOk()) - .andExpect(jsonPath("items", hasSize(15))) + .andExpect(jsonPath("items", hasSize(4))) .andExpect(jsonPath("items[0].persistentId", is(datasetPersistentId))) - .andExpect(jsonPath("items[0].id", is((int) datasetId))) + .andExpect(jsonPath("items[0].id", is( (int) datasetId))) .andExpect(jsonPath("items[1].persistentId", is("dmbq4v"))) .andExpect(jsonPath("items[1].id", is(9))) - .andExpect(jsonPath("items[2].persistentId", is("prblMo"))) - .andExpect(jsonPath("items[2].id", is(13))) - .andExpect(jsonPath("items[3].persistentId", is("dVZeir"))) - .andExpect(jsonPath("items[3].id", is(15))) - .andExpect(jsonPath("items[4].persistentId", is("2CwYCU"))) - .andExpect(jsonPath("items[4].id", is(14))) - .andExpect(jsonPath("items[5].persistentId", is("tqmbGY"))) - .andExpect(jsonPath("items[5].id", is(12))) - .andExpect(jsonPath("items[6].persistentId", is("gQu2wl"))) - .andExpect(jsonPath("items[6].id", is(24))) - .andExpect(jsonPath("items[7].persistentId", is("EPax9f"))) - .andExpect(jsonPath("items[7].id", is(16))) - .andExpect(jsonPath("items[8].persistentId", is("xYpCdU"))) - .andExpect(jsonPath("items[8].id", is(18))) - .andExpect(jsonPath("items[9].persistentId", is("U8vUos"))) - .andExpect(jsonPath("items[9].id", is(20))) - .andExpect(jsonPath("items[10].persistentId", is("sQY6US"))) - .andExpect(jsonPath("items[10].id", is(23))) - .andExpect(jsonPath("items[11].persistentId", is("HLYtzq"))) - .andExpect(jsonPath("items[11].id", is(17))) - .andExpect(jsonPath("items[12].persistentId", is("BNw43H"))) - .andExpect(jsonPath("items[12].id", is(22))) - .andExpect(jsonPath("items[13].persistentId", is("dU0BZc"))) - .andExpect(jsonPath("items[13].id", is(11))) - .andExpect(jsonPath("items[14].persistentId", is("k68NbF"))) - .andExpect(jsonPath("items[14].id", is(19))); + .andExpect(jsonPath("items[2].persistentId", is("tqmbGY"))) + .andExpect(jsonPath("items[2].id", is(12))) + .andExpect(jsonPath("items[3].persistentId", is("dU0BZc"))) + .andExpect(jsonPath("items[3].id", is(11))); dataset.setLabel("A first "); @@ -283,37 +217,15 @@ public class ItemControllerITCase { .param("order", "label") .header("Authorization", CONTRIBUTOR_JWT)) .andExpect(status().isOk()) - .andExpect(jsonPath("items", hasSize(15))) + .andExpect(jsonPath("items", hasSize(4))) .andExpect(jsonPath("items[0].persistentId", is(datasetPersistentId))) - .andExpect(jsonPath("items[0].id", is((int) datasetIdUpdated))) + .andExpect(jsonPath("items[0].id", is( (int) datasetIdUpdated))) .andExpect(jsonPath("items[1].persistentId", is("dmbq4v"))) .andExpect(jsonPath("items[1].id", is(9))) - .andExpect(jsonPath("items[2].persistentId", is("prblMo"))) - .andExpect(jsonPath("items[2].id", is(13))) - .andExpect(jsonPath("items[3].persistentId", is("dVZeir"))) - .andExpect(jsonPath("items[3].id", is(15))) - .andExpect(jsonPath("items[4].persistentId", is("2CwYCU"))) - .andExpect(jsonPath("items[4].id", is(14))) - .andExpect(jsonPath("items[5].persistentId", is("tqmbGY"))) - .andExpect(jsonPath("items[5].id", is(12))) - .andExpect(jsonPath("items[6].persistentId", is("gQu2wl"))) - .andExpect(jsonPath("items[6].id", is(24))) - .andExpect(jsonPath("items[7].persistentId", is("EPax9f"))) - .andExpect(jsonPath("items[7].id", is(16))) - .andExpect(jsonPath("items[8].persistentId", is("xYpCdU"))) - .andExpect(jsonPath("items[8].id", is(18))) - .andExpect(jsonPath("items[9].persistentId", is("U8vUos"))) - .andExpect(jsonPath("items[9].id", is(20))) - .andExpect(jsonPath("items[10].persistentId", is("sQY6US"))) - .andExpect(jsonPath("items[10].id", is(23))) - .andExpect(jsonPath("items[11].persistentId", is("HLYtzq"))) - .andExpect(jsonPath("items[11].id", is(17))) - .andExpect(jsonPath("items[12].persistentId", is("BNw43H"))) - .andExpect(jsonPath("items[12].id", is(22))) - .andExpect(jsonPath("items[13].persistentId", is("dU0BZc"))) - .andExpect(jsonPath("items[13].id", is(11))) - .andExpect(jsonPath("items[14].persistentId", is("k68NbF"))) - .andExpect(jsonPath("items[14].id", is(19))); + .andExpect(jsonPath("items[2].persistentId", is("tqmbGY"))) + .andExpect(jsonPath("items[2].id", is(12))) + .andExpect(jsonPath("items[3].persistentId", is("dU0BZc"))) + .andExpect(jsonPath("items[3].id", is(11))); } }