Skip to content

Commit

Permalink
Feat: 쿼리 테스트 코드 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
yxhwxn committed Aug 6, 2024
1 parent 9638f90 commit 58a0cc0
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/test/java/com/cmc/suppin/SuppinApplicationTests.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
package com.cmc.suppin;

import com.cmc.suppin.global.enums.UserStatus;
import com.cmc.suppin.member.domain.repository.MemberRepository;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import static org.assertj.core.api.AssertionsForClassTypes.assertThat;

@SpringBootTest
class SuppinApplicationTests {

@Test
void contextLoads() {
}
@Autowired
private MemberRepository memberRepository;

@Test
public void testExistsByUserIdAndStatusNot() {
// Given
String userId = "testUser";
UserStatus status = UserStatus.DELETED;

// When
boolean exists = memberRepository.existsByUserIdAndStatusNot(userId, status);

// Then
assertThat(exists).isFalse();
}
}

0 comments on commit 58a0cc0

Please sign in to comment.