Skip to content

Commit

Permalink
test: testing qr code creation
Browse files Browse the repository at this point in the history
  • Loading branch information
jpdev01 committed Dec 28, 2024
1 parent 5b8e205 commit 6ce9a76
Showing 1 changed file with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package integration.io.github.jpdev.asaassdk.rest.pix.qrcode;

import integration.io.github.jpdev.asaassdk.AsaasClientMock;
import io.github.jpdev.asaassdk.rest.pix.qrcode.PixQrCode;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assumptions.assumeTrue;
import io.github.jpdev.asaassdk.utils.Money;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

import java.math.BigDecimal;

public class PixQrCodeTest {

@BeforeAll
static void setup() {
AsaasClientMock.create();
}

@Test
@Tag("integration")
@DisplayName("Teste de criação de QR Code Pix")
void creating() {
BigDecimal value = Money.create(10.0);
String description = "Teste unitário";
Integer expirationSeconds = 100;

PixQrCode qrCode = PixQrCode.creator()
.setValue(value)
.setDescription(description)
.setExpirationSeconds(expirationSeconds)
.create();

assertNotNull(qrCode, "QR Code não criado.");
assertNotNull(qrCode.expirationDate);
}
}

0 comments on commit 6ce9a76

Please sign in to comment.