1414
1515public class LiveTest {
1616
17- private final FormAuthConfig formAuthConfig = new FormAuthConfig ("http://localhost:8082/spring-security-custom-permission /login" , "username" , "password" );
17+ private final FormAuthConfig formAuthConfig = new FormAuthConfig ("http://localhost:8082/spring-security-mvc-boot /login" , "username" , "password" );
1818
1919 @ Test
2020 public void givenUserWithReadPrivilegeAndHasPermission_whenGetFooById_thenOK () {
21- final Response response = givenAuth ("john" , "123" ).get ("http://localhost:8082/spring-security-custom-permission /foos/1" );
21+ final Response response = givenAuth ("john" , "123" ).get ("http://localhost:8082/spring-security-mvc-boot /foos/1" );
2222 assertEquals (200 , response .getStatusCode ());
2323 assertTrue (response .asString ().contains ("id" ));
2424 }
2525
2626 @ Test
2727 public void givenUserWithNoWritePrivilegeAndHasPermission_whenPostFoo_thenForbidden () {
28- final Response response = givenAuth ("john" , "123" ).contentType (MediaType .APPLICATION_JSON_VALUE ).body (new Foo ("sample" )).post ("http://localhost:8082/spring-security-custom-permission /foos" );
28+ final Response response = givenAuth ("john" , "123" ).contentType (MediaType .APPLICATION_JSON_VALUE ).body (new Foo ("sample" )).post ("http://localhost:8082/spring-security-mvc-boot /foos" );
2929 assertEquals (403 , response .getStatusCode ());
3030 }
3131
3232 @ Test
3333 public void givenUserWithWritePrivilegeAndHasPermission_whenPostFoo_thenOk () {
34- final Response response = givenAuth ("tom" , "111" ).contentType (MediaType .APPLICATION_JSON_VALUE ).body (new Foo ("sample" )).post ("http://localhost:8082/spring-security-custom-permission /foos" );
34+ final Response response = givenAuth ("tom" , "111" ).contentType (MediaType .APPLICATION_JSON_VALUE ).body (new Foo ("sample" )).post ("http://localhost:8082/spring-security-mvc-boot /foos" );
3535 assertEquals (201 , response .getStatusCode ());
3636 assertTrue (response .asString ().contains ("id" ));
3737 }
@@ -40,22 +40,22 @@ public void givenUserWithWritePrivilegeAndHasPermission_whenPostFoo_thenOk() {
4040
4141 @ Test
4242 public void givenUserMemberInOrganization_whenGetOrganization_thenOK () {
43- final Response response = givenAuth ("john" , "123" ).get ("http://localhost:8082/spring-security-custom-permission /organizations/1" );
43+ final Response response = givenAuth ("john" , "123" ).get ("http://localhost:8082/spring-security-mvc-boot /organizations/1" );
4444 assertEquals (200 , response .getStatusCode ());
4545 assertTrue (response .asString ().contains ("id" ));
4646 }
4747
4848 @ Test
4949 public void givenUserMemberNotInOrganization_whenGetOrganization_thenForbidden () {
50- final Response response = givenAuth ("john" , "123" ).get ("http://localhost:8082/spring-security-custom-permission /organizations/2" );
50+ final Response response = givenAuth ("john" , "123" ).get ("http://localhost:8082/spring-security-mvc-boot /organizations/2" );
5151 assertEquals (403 , response .getStatusCode ());
5252 }
5353
5454 //
5555
5656 @ Test
5757 public void givenDisabledSecurityExpression_whenGetFooByName_thenError () {
58- final Response response = givenAuth ("john" , "123" ).get ("http://localhost:8082/spring-security-custom-permission /foos?name=sample" );
58+ final Response response = givenAuth ("john" , "123" ).get ("http://localhost:8082/spring-security-mvc-boot /foos?name=sample" );
5959 assertEquals (500 , response .getStatusCode ());
6060 assertTrue (response .asString ().contains ("method hasAuthority() not allowed" ));
6161 }
0 commit comments