Commit c9198993 authored by Ghitha Dinan's avatar Ghitha Dinan

add unit test

parent 33c81657
package id.go.kemenag.madrasah.pmrms.auth
import id.go.kemenag.madrasah.pmrms.auth.model.request.auth.LoginRequest
import id.go.kemenag.madrasah.pmrms.auth.model.response.ReturnData
import id.go.kemenag.madrasah.pmrms.auth.service.AuthService
import org.assertj.core.api.Assertions
import org.junit.jupiter.api.Test
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.http.HttpStatus
import org.springframework.http.ResponseEntity
@SpringBootTest
class AuthServiceTest {
@Autowired
private lateinit var service: AuthService
@Test
fun testLogin() {
val test: ResponseEntity<ReturnData> = service.login(LoginRequest("admin@madrasah.kemenag.go.id", "123456"))
Assertions.assertThat(test.statusCode).isNotEqualTo(HttpStatus.INTERNAL_SERVER_ERROR)
}
@Test
fun testDetail() {
val test: ResponseEntity<ReturnData> = service.detail()
Assertions.assertThat(test.statusCode).isNotEqualTo(HttpStatus.INTERNAL_SERVER_ERROR)
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment