Enable creating an API using Spring Web #5
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "spring"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
SciPro will have to provide information to the upcoming student portal. Wicket does not have the ability to serve JSON in the usual REST way and is only able to serve HTML. The most common way to write JSON over HTTP API:s in Java is using Spring Web, but currently SciPro uses Guice for dependency injection rather than Spring which makes adding Spring Web a bit more tricky.
This pull request attempts to solve this by doing the following;
The hope is that these changes will bring the following benefits;
@ -0,0 +1,29 @@
package se.su.dsv.scipro.api;
Serves as placeholder, will be cleaned up later.
@ -43,6 +43,7 @@ public class UserProfileServiceImpl extends AbstractServiceImpl<UserProfile, Lon
}
@Override
@jakarta.transaction.Transactional
@Transactional should be enough? Why need full qualified annotation name?
@ -0,0 +1,4 @@
package se.su.dsv.scipro.war;
What's the purpose of this marker interface?
@ -18,2 +30,4 @@
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
public abstract class GuiceTest {
Are we going to change all Guice tests to Spring tests later? Or what is the plan?
WIP: Enable creating an API using Spring Webto Enable creating an API using Spring WebFor some reason new commits are not shown here in the conversation but can be found in the "Commits" tab.
@ -0,0 +2,4 @@
import jakarta.persistence.EntityManager;
import jakarta.persistence.EntityManagerFactory;
import jakarta.servlet.FilterChain;
Clean up unused imports
@ -0,0 +7,4 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
public class UrkundSettingsRepositoryTest extends SpringTest {
Should extend IntegrationTest instead of SpringTest
@ -0,0 +16,4 @@
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
public class UrkundSubmissionRepositoryTest extends SpringTest {
Should extend IntegrationTest instead of SpringTest
@ -0,0 +13,4 @@
public class ApiController {
private final UserService userService;
@Inject
Is @Inject needed because the UserService is in the core module?
Because normally we don't need to @Inject when doing constructor based injection in Spring