Search in sources :

Example 6 with ServiceLimits

use of io.lumeer.api.model.ServiceLimits in project engine by Lumeer.

the class OrganizationServiceIT method testPaymentsAssessments.

@Test
public void testPaymentsAssessments() {
    paymentGatewayFacade.setDryRun(true);
    createOrganization(CODE1);
    createOrganization(CODE2);
    Payment payment = new Payment(null, new Date(), 1770, "1234", Date.from(ZonedDateTime.ofLocal(LocalDateTime.of(2018, 4, 1, 12, 0), ZoneId.systemDefault(), null).toInstant()), Date.from(ZonedDateTime.ofLocal(LocalDateTime.of(2019, 4, 1, 12, 0), ZoneId.systemDefault(), null).toInstant()), Payment.PaymentState.CREATED, Payment.ServiceLevel.BASIC, 10, "cz", "CZK", "");
    payment = createPayment(CODE1, payment);
    ServiceLimits serviceLimits = getServiceLimits(CODE1);
    assertThat(serviceLimits.getServiceLevel()).isEqualTo(Payment.ServiceLevel.FREE);
// todo call updateService once we know the message format
}
Also used : Payment(io.lumeer.api.model.Payment) ServiceLimits(io.lumeer.api.model.ServiceLimits) Date(java.util.Date) Test(org.junit.Test)

Example 7 with ServiceLimits

use of io.lumeer.api.model.ServiceLimits in project engine by Lumeer.

the class PaymentFacadeIT method testNoPayment.

@Test
public void testNoPayment() {
    final ServiceLimits limits = paymentFacade.getServiceLimitsAt(organization, new Date());
    assertThat(limits.getServiceLevel()).as("With no payments paid, we should have the FREE tier.").isEqualTo(Payment.ServiceLevel.FREE);
}
Also used : ServiceLimits(io.lumeer.api.model.ServiceLimits) Date(java.util.Date) Test(org.junit.Test)

Aggregations

ServiceLimits (io.lumeer.api.model.ServiceLimits)7 Test (org.junit.Test)5 Payment (io.lumeer.api.model.Payment)3 Date (java.util.Date)2