3412 TR Remember their selected publishing consent

This commit is contained in:
Andreas Svanberg 2024-10-16 10:20:26 +02:00
parent 2ae764a0ad
commit 7ec355718b
2 changed files with 4 additions and 1 deletions
view/src
main/java/se/su/dsv/scipro/project/panels
test/java/se/su/dsv/scipro

@ -113,7 +113,7 @@ public class FinalStepsPanel extends GenericPanel<Project> {
IModel<PublishingConsentService.PublishingConsent> publishingConsent = LoadableDetachableModel.of(() ->
publishingConsentService.getPublishingConsent(getModelObject(), SciProSession.get().getUser()));
levelModel = new Model<>();
levelModel = new Model<>(publishingConsent.getObject().selected());
FormComponent<PublishingConsentService.Level> publishingConsentLevel = new BootstrapRadioChoice<>(
"publishingConsentLevel",
levelModel,

@ -143,6 +143,7 @@ import java.util.*;
import static org.mockito.ArgumentMatchers.*;
import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@ExtendWith(MockitoExtension.class)
public abstract class SciProTest {
@ -391,6 +392,8 @@ public abstract class SciProTest {
publicationMetadata.setProject(answer.getArgument(0));
return publicationMetadata;
});
lenient().when(publishingConsentService.getPublishingConsent(any(), any()))
.thenReturn(new PublishingConsentService.PublishingConsent(null, List.of()));
}
@BeforeEach