Search in sources :

Example 21 with ProvQuote

use of org.ligoj.app.plugin.prov.model.ProvQuote in project plugin-prov by ligoj.

the class ProvResourceTest method update.

@Test
public void update() {
    final QuoteEditionVo quote = new QuoteEditionVo();
    quote.setName("name1");
    quote.setDescription("description1");
    quote.setLocation("region-1");
    final FloatingCost cost = resource.update(subscription, quote);
    checkCost(cost, 3165.4, 5615.0, false);
    ProvQuote quote2 = repository.findByNameExpected("name1");
    Assertions.assertEquals("description1", quote2.getDescription());
    Assertions.assertEquals("region-1", quote2.getLocation().getName());
}
Also used : ProvQuote(org.ligoj.app.plugin.prov.model.ProvQuote) AbstractAppTest(org.ligoj.app.AbstractAppTest) Test(org.junit.jupiter.api.Test)

Example 22 with ProvQuote

use of org.ligoj.app.plugin.prov.model.ProvQuote in project plugin-prov by ligoj.

the class ProvResourceTest method getKey.

@Test
public void getKey() {
    Assertions.assertEquals("service:prov", resource.getKey());
    // Only there for coverage of associations required by JPA
    new ProvQuote().setStorages(null);
    new ProvQuote().getStorages();
    new ProvQuote().setInstances(null);
    new ProvQuoteInstance().setStorages(null);
    Rate.valueOf(Rate.GOOD.name());
    ProvStorageOptimized.valueOf(ProvStorageOptimized.IOPS.name());
    VmOs.valueOf(VmOs.LINUX.name());
    ProvTenancy.valueOf(ProvTenancy.DEDICATED.name());
}
Also used : ProvQuote(org.ligoj.app.plugin.prov.model.ProvQuote) ProvQuoteInstance(org.ligoj.app.plugin.prov.model.ProvQuoteInstance) AbstractAppTest(org.ligoj.app.AbstractAppTest) Test(org.junit.jupiter.api.Test)

Aggregations

ProvQuote (org.ligoj.app.plugin.prov.model.ProvQuote)22 Consumes (javax.ws.rs.Consumes)8 Path (javax.ws.rs.Path)8 DELETE (javax.ws.rs.DELETE)6 POST (javax.ws.rs.POST)6 PUT (javax.ws.rs.PUT)6 ProvLocation (org.ligoj.app.plugin.prov.model.ProvLocation)6 ProvQuoteInstance (org.ligoj.app.plugin.prov.model.ProvQuoteInstance)6 Function (java.util.function.Function)5 Transactional (javax.transaction.Transactional)5 GET (javax.ws.rs.GET)5 PathParam (javax.ws.rs.PathParam)5 Produces (javax.ws.rs.Produces)5 Context (javax.ws.rs.core.Context)5 MediaType (javax.ws.rs.core.MediaType)5 UriInfo (javax.ws.rs.core.UriInfo)5 ProvUsage (org.ligoj.app.plugin.prov.model.ProvUsage)5 TableItem (org.ligoj.bootstrap.core.json.TableItem)5 DataTableAttributes (org.ligoj.bootstrap.core.json.datatable.DataTableAttributes)5 Autowired (org.springframework.beans.factory.annotation.Autowired)5