Password reset link test condition more strict and move all WebWolf links to /WebWolf (#1645)
* better check on host and port for password reset and make context roots more flexible * spotless applied * removed hardcoded /WebGoat from js * removed hardcoded /WebGoat from js * fix spotless * fix scoreboard * upgrade WebWolf bootstrap version and icons and templates - part 1 * fixed more bootstrap 5 style issues and context path issues * organized WebSecurityConfig based on latest conventions and added basic support for oauth (more work needed) * spotless applied * added mock bean * requires updates to properties - commented for now * requires updates to properties - commented for now * oauth secrets through env values * user creation after oauth login * integration test against non default context paths * adjusted StartupMessage * add global model element username * conditionally show login oauth links * fixed WebWolf login --------- Co-authored-by: René Zubcevic <rene@Mac-mini-van-Rene.local>
This commit is contained in:
@ -19,6 +19,7 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.test.mock.mockito.MockBean;
|
||||
import org.springframework.boot.test.web.server.LocalServerPort;
|
||||
import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository;
|
||||
import org.springframework.test.context.TestPropertySource;
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
import org.springframework.web.context.WebApplicationContext;
|
||||
@ -44,6 +45,8 @@ public abstract class LessonTest {
|
||||
@MockBean protected WebSession webSession;
|
||||
@MockBean private Language language;
|
||||
|
||||
@MockBean private ClientRegistrationRepository clientRegistrationRepository;
|
||||
|
||||
@Value("${webgoat.user.directory}")
|
||||
protected String webGoatHomeDirectory;
|
||||
|
||||
|
@ -46,6 +46,7 @@ import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
|
||||
import org.springframework.boot.test.mock.mockito.MockBean;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository;
|
||||
import org.springframework.security.test.context.support.WithMockUser;
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
|
||||
@ -55,6 +56,8 @@ public class MailboxControllerTest {
|
||||
|
||||
@Autowired private MockMvc mvc;
|
||||
@MockBean private MailboxRepository mailbox;
|
||||
|
||||
@MockBean private ClientRegistrationRepository clientRegistrationRepository;
|
||||
@MockBean private UserService userService;
|
||||
@Autowired private ObjectMapper objectMapper;
|
||||
|
||||
|
Reference in New Issue
Block a user