Created
December 22, 2023 14:59
-
-
Save mihaita-tinta/1a6ff2145a2616a542b3e7d2ae9b69ee to your computer and use it in GitHub Desktop.
simplified
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mih.playground.driver; | |
import com.datastax.driver.core.utils.UUIDs; | |
import com.mih.playground.Infrastructure; | |
import org.junit.jupiter.api.Assertions; | |
import org.junit.jupiter.api.Test; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.boot.test.autoconfigure.data.cassandra.DataCassandraTest; | |
import org.springframework.context.annotation.Import; | |
import java.time.ZonedDateTime; | |
import static org.junit.jupiter.api.Assertions.assertEquals; | |
import static org.junit.jupiter.api.Assertions.assertNotNull; | |
@DataCassandraTest | |
@Import(Infrastructure.class) | |
class DriverRepositoryTest { | |
@Autowired | |
DriverRepository repository; | |
@Test | |
void test() { | |
Driver driver = new Driver(UUIDs.timeBased(), ZonedDateTime.now().toEpochSecond(), "nickname"); | |
Driver db = repository.save(driver); | |
assertNotNull(db.getId()); | |
assertEquals(1, repository.findAll().size()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment