Skip to content

Commit

Permalink
fix(user): turn update agreement api into writable trasaction
Browse files Browse the repository at this point in the history
  • Loading branch information
wwingyou committed Jan 26, 2025
1 parent 8d96813 commit 324ee64
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ public UserRegisterStatusDto getRegisterStatus(String userId) {
}

@Override
@Transactional
public void updateAgreementInfo(String userId, UserAgreementDto request) {
// TODO: throw error when required agreement is not agreed
Optional<User> result = userRepository.findById(userId);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.goolbitg.api.integration;

import jakarta.transaction.Transactional;

import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.test.context.support.WithMockUser;
import org.springframework.test.web.servlet.MockMvc;

import com.fasterxml.jackson.databind.ObjectMapper;

/**
* BuyOrNotIntegrationTest
*/
@CustomIntegrationTest
public class BuyOrNotIntegrationTest {

@Autowired
private MockMvc mockMvc;
@Autowired
private ObjectMapper mapper;

private final String ROOT_USER_ID = "id0001";
private final String NORMAL_USER_ID = "id0002";

@Test
@Transactional
@WithMockUser(ROOT_USER_ID)
void get_buyOrNots() throws Exception {

}
}

0 comments on commit 324ee64

Please sign in to comment.