Skip to content

Commit

Permalink
Revert "Refactor tests"
Browse files Browse the repository at this point in the history
This reverts commit 8acca09.
  • Loading branch information
code28 committed Jun 28, 2024
1 parent 8acca09 commit 0db4c34
Showing 1 changed file with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,23 @@ package software.tice.wallet.attestation.services
import io.jsonwebtoken.Jwts
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
import org.mockito.*
import org.mockito.Mockito.verify
import org.mockito.junit.jupiter.MockitoExtension
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.boot.test.mock.mockito.MockBean
import org.springframework.test.context.ContextConfiguration
import software.tice.wallet.attestation.repositories.UserEntity
import software.tice.wallet.attestation.repositories.UserRepository
import software.tice.wallet.attestation.requests.AttestationRequest
import java.security.KeyPair
import java.util.*
import kotlin.test.assertEquals

@SpringBootTest
@ExtendWith(MockitoExtension::class)
@ContextConfiguration(classes = [UserRepository::class])
class WalletApiServiceTests {

@MockBean
internal class WalletApiServiceTests {

@Mock
private lateinit var userRepository: UserRepository

private lateinit var privateKey: String

private lateinit var walletApiService: WalletApiService

@Captor
Expand All @@ -35,7 +30,8 @@ class WalletApiServiceTests {

@BeforeEach
fun setup() {
val privateKey = Base64.getEncoder().encodeToString(keyPair.private.encoded)
MockitoAnnotations.openMocks(this)
privateKey = Base64.getEncoder().encodeToString(keyPair.private.encoded)
walletApiService = WalletApiService(privateKey, userRepository)
}

Expand Down

0 comments on commit 0db4c34

Please sign in to comment.