Skip to content

Commit

Permalink
Bug Fix Integration Test βœοΈπŸ“— :octocat: πŸ³β¬†
Browse files Browse the repository at this point in the history
  • Loading branch information
hendisantika committed Apr 15, 2024
1 parent 617cfd4 commit 8a91817
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
9 changes: 9 additions & 0 deletions logs/browserstack-plugin.log
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,12 @@
09:51:45.792 [ApplicationImpl pooled thread 3] INFO c.b.l.BrowserStackRunExtension - junit
09:51:45.793 [ApplicationImpl pooled thread 3] INFO com.browserstack.utils.Helpers - null
09:51:45.793 [ApplicationImpl pooled thread 3] INFO c.b.l.BrowserStackRunExtension - Agent path: null
09:56:08.926 [ApplicationImpl pooled thread 39] INFO c.b.l.BrowserStackRunExtension - junit
09:56:08.926 [ApplicationImpl pooled thread 39] INFO com.browserstack.utils.Helpers - null
09:56:08.927 [ApplicationImpl pooled thread 39] INFO c.b.l.BrowserStackRunExtension - Agent path: null
09:56:24.452 [ApplicationImpl pooled thread 39] INFO c.b.l.BrowserStackRunExtension - junit
09:56:24.452 [ApplicationImpl pooled thread 39] INFO com.browserstack.utils.Helpers - null
09:56:24.452 [ApplicationImpl pooled thread 39] INFO c.b.l.BrowserStackRunExtension - Agent path: null
10:07:57.014 [ApplicationImpl pooled thread 55] INFO c.b.l.BrowserStackRunExtension - junit
10:07:57.014 [ApplicationImpl pooled thread 55] INFO com.browserstack.utils.Helpers - null
10:07:57.015 [ApplicationImpl pooled thread 55] INFO c.b.l.BrowserStackRunExtension - Agent path: null
Original file line number Diff line number Diff line change
@@ -1,15 +1,38 @@
package com.hendisantika.sekolah;

import com.hendisantika.sekolah.entity.Guru;
import com.hendisantika.sekolah.repository.GuruRepository;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.testcontainers.junit.jupiter.Testcontainers;

import java.time.LocalDate;
import java.util.List;

import static org.junit.jupiter.api.Assertions.assertEquals;

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE)
@Testcontainers
class SekolahApplicationTests {
@Autowired
private GuruRepository guruRepository;

@BeforeEach
void init() {
guruRepository.deleteAll();
}

@Test
void contextLoads() {
void shouldCreateOnePerson() {
final var guru = guruRepository.saveAll(List.of(new Guru("212", "Itadori Yuji", "L", "Tokyo", LocalDate.now(), "Dukun",
"photo", "photoBase64", "filename", new byte[(int) "Itadori Yuji".length()]))
);
assertEquals(1, guru.size());
final var person = guru.get(0);
assertEquals("Itadori Yuji", person.getNama());
assertEquals("212", person.getNip());
}

}

0 comments on commit 8a91817

Please sign in to comment.