Search in sources :

Example 41 with CustomerData

use of io.codekvast.common.customer.CustomerData in project codekvast by crispab.

the class IntakeIntegrationTest method should_accept_valid_getCustomerDataByExternalId_with_pricePlanOverride.

@Test
@Sql(scripts = "/sql/base-data.sql")
public void should_accept_valid_getCustomerDataByExternalId_with_pricePlanOverride() {
    CustomerData customerData = customerService.getCustomerDataByExternalId("test", "external-1");
    assertThat(customerData.getCustomerId(), is(1L));
    assertThat(customerData.getCustomerName(), is("Demo"));
    assertThat(customerData.getPricePlan().getName(), is("DEMO"));
    assertThat(customerData.getPricePlan().getOverrideBy(), is("integration test"));
}
Also used : CustomerData(io.codekvast.common.customer.CustomerData) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) Test(org.junit.Test) Sql(org.springframework.test.context.jdbc.Sql)

Example 42 with CustomerData

use of io.codekvast.common.customer.CustomerData in project codekvast by crispab.

the class IntakeIntegrationTest method should_accept_publication.

@Test
@Sql(scripts = "/sql/base-data.sql")
public void should_accept_publication() {
    CustomerData customerData = customerService.getCustomerDataByLicenseKey("");
    customerService.assertPublicationSize(customerData, 10);
}
Also used : CustomerData(io.codekvast.common.customer.CustomerData) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) Test(org.junit.Test) Sql(org.springframework.test.context.jdbc.Sql)

Example 43 with CustomerData

use of io.codekvast.common.customer.CustomerData in project codekvast by crispab.

the class IntakeIntegrationTest method should_reject_publication_invalid_licenseKey.

@Test(expected = AuthenticationCredentialsNotFoundException.class)
@Sql(scripts = "/sql/base-data.sql")
public void should_reject_publication_invalid_licenseKey() {
    CustomerData customerData = customerService.getCustomerDataByLicenseKey("undefined");
    customerService.assertPublicationSize(customerData, 10);
}
Also used : CustomerData(io.codekvast.common.customer.CustomerData) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) Test(org.junit.Test) Sql(org.springframework.test.context.jdbc.Sql)

Example 44 with CustomerData

use of io.codekvast.common.customer.CustomerData in project codekvast by crispab.

the class DashboardIntegrationTest method should_accept_valid_getCustomerDataByExternalId_with_pricePlanOverride.

@Test
@Sql(scripts = "/sql/base-data.sql")
public void should_accept_valid_getCustomerDataByExternalId_with_pricePlanOverride() {
    CustomerData customerData = customerService.getCustomerDataByExternalId("test", "external-1");
    assertThat(customerData.getCustomerId(), is(1L));
    assertThat(customerData.getCustomerName(), is("Demo"));
    assertThat(customerData.getPricePlan().getName(), is("DEMO"));
    assertThat(customerData.getPricePlan().getOverrideBy(), is("integration test"));
}
Also used : CustomerData(io.codekvast.common.customer.CustomerData) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) Test(org.junit.Test) Sql(org.springframework.test.context.jdbc.Sql)

Example 45 with CustomerData

use of io.codekvast.common.customer.CustomerData in project codekvast by crispab.

the class DashboardIntegrationTest method should_reject_publication_too_large.

@Test(expected = LicenseViolationException.class)
@Sql(scripts = "/sql/base-data.sql")
public void should_reject_publication_too_large() {
    CustomerData customerData = customerService.getCustomerDataByLicenseKey("");
    customerService.assertPublicationSize(customerData, 100_000);
}
Also used : CustomerData(io.codekvast.common.customer.CustomerData) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) Test(org.junit.Test) Sql(org.springframework.test.context.jdbc.Sql)

Aggregations

CustomerData (io.codekvast.common.customer.CustomerData)48 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)28 Sql (org.springframework.test.context.jdbc.Sql)28 Test (org.junit.Test)22 Instant (java.time.Instant)13 Test (org.junit.jupiter.api.Test)10 Transactional (org.springframework.transaction.annotation.Transactional)9 PricePlanDefaults (io.codekvast.common.customer.PricePlanDefaults)4 PricePlan (io.codekvast.common.customer.PricePlan)3 GetStatusResponse (io.codekvast.dashboard.dashboard.model.status.GetStatusResponse)3 Timestamp (java.sql.Timestamp)3 CollectionStartedEvent (io.codekvast.common.messaging.model.CollectionStartedEvent)2 User (io.codekvast.login.model.User)2 CacheEvict (org.springframework.cache.annotation.CacheEvict)2 LicenseViolationException (io.codekvast.common.customer.LicenseViolationException)1 LicenseViolationEvent (io.codekvast.common.messaging.model.LicenseViolationEvent)1 GetMethodsFormData (io.codekvast.dashboard.dashboard.model.methods.GetMethodsFormData)1 AgentDescriptor (io.codekvast.dashboard.dashboard.model.status.AgentDescriptor)1 ApplicationDescriptor2 (io.codekvast.dashboard.dashboard.model.status.ApplicationDescriptor2)1 EnvironmentStatusDescriptor (io.codekvast.dashboard.dashboard.model.status.EnvironmentStatusDescriptor)1