- Introduced user registration
- Now using Spring Boot for classloading, this way local development does not need to restart the complete server - Fixed all kinds of dependencies on the names of the lessons necessary to keep in mind during the creation of a lesson. - Simplied loading of resources, by adding resource mappings in MvcConfig. - Refactored plugin loading, now only one class is left for loading the lessons.
This commit is contained in:
@ -55,7 +55,7 @@ public class AssignmentEndpointTest {
|
||||
protected PluginMessages pluginMessages = new PluginMessages(messages, language);
|
||||
|
||||
public void init(AssignmentEndpoint a) {
|
||||
messages.setBasenames("classpath:/i18n/messages", "classpath:/plugin/i18n/WebGoatLabels");
|
||||
messages.setBasenames("classpath:/i18n/messages", "classpath:/i18n/WebGoatLabels");
|
||||
ReflectionTestUtils.setField(a, "userTracker", userTracker);
|
||||
ReflectionTestUtils.setField(a, "userSessionData", userSessionData);
|
||||
ReflectionTestUtils.setField(a, "webSession", webSession);
|
||||
|
@ -8,9 +8,9 @@ import org.owasp.webgoat.lessons.Assignment;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.UUID;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.mockito.Matchers.eq;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
@ -68,7 +68,7 @@ public class UserTrackerTest {
|
||||
|
||||
@Test
|
||||
public void assignmentFailedShouldIncrementAttempts() {
|
||||
UserTracker userTracker = new UserTracker(home.getParent(), "test");
|
||||
UserTracker userTracker = new UserTracker(home.getParent(), UUID.randomUUID().toString());
|
||||
AbstractLesson lesson = mock(AbstractLesson.class);
|
||||
when(lesson.getAssignments()).thenReturn(Lists.newArrayList(new Assignment("assignment", "assignment")));
|
||||
userTracker.getLessonTracker(lesson);
|
||||
@ -83,6 +83,7 @@ public class UserTrackerTest {
|
||||
UserTracker userTracker = new UserTracker(home.getParent(), "test");
|
||||
AbstractLesson lesson = mock(AbstractLesson.class);
|
||||
when(lesson.getAssignments()).thenReturn(Lists.newArrayList(new Assignment("assignment", "assignment")));
|
||||
userTracker.getLessonTracker(lesson);
|
||||
userTracker.assignmentSolved(lesson, "assignment");
|
||||
|
||||
assertThat(userTracker.getLessonTracker(lesson).isLessonSolved()).isTrue();
|
||||
@ -95,6 +96,7 @@ public class UserTrackerTest {
|
||||
UserTracker userTracker = new UserTracker(home.getParent(), "test");
|
||||
AbstractLesson lesson = mock(AbstractLesson.class);
|
||||
when(lesson.getAssignments()).thenReturn(Lists.newArrayList(new Assignment("assignment", "assignment")));
|
||||
userTracker.getLessonTracker(lesson);
|
||||
userTracker.assignmentSolved(lesson, "assignment");
|
||||
|
||||
assertThat(userTracker.numberOfAssignmentsSolved()).isEqualTo(1);
|
||||
|
Reference in New Issue
Block a user