Search in sources :

Example 6 with CatalogDTO

use of org.commonjava.indy.autoprox.rest.dto.CatalogDTO in project indy by Commonjava.

the class CreateRuleAndVerifyInListingTest method createRuleAndVerifyListingReflectsIt.

@Test
public void createRuleAndVerifyListingReflectsIt() throws Exception {
    final CatalogDTO catalog = module.getCatalog();
    assertThat(catalog.isEnabled(), equalTo(true));
    assertThat(catalog.getRules().isEmpty(), equalTo(true));
    final RuleDTO rule = getRule("0001-simple-rule", "rules/simple-rule.groovy");
    final RuleDTO dto = module.storeRule(rule);
    assertThat(dto, notNullValue());
    final CatalogDTO resultCatalog = module.getCatalog();
    final List<RuleDTO> rules = resultCatalog.getRules();
    assertThat(rules.size(), equalTo(1));
    assertThat(rules.get(0), equalTo(dto));
}
Also used : CatalogDTO(org.commonjava.indy.autoprox.rest.dto.CatalogDTO) RuleDTO(org.commonjava.indy.autoprox.rest.dto.RuleDTO) Test(org.junit.Test)

Aggregations

CatalogDTO (org.commonjava.indy.autoprox.rest.dto.CatalogDTO)6 Test (org.junit.Test)5 RuleDTO (org.commonjava.indy.autoprox.rest.dto.RuleDTO)4 ApiOperation (io.swagger.annotations.ApiOperation)1 ApiResponse (io.swagger.annotations.ApiResponse)1 ApiResponses (io.swagger.annotations.ApiResponses)1 File (java.io.File)1 GET (javax.ws.rs.GET)1 Produces (javax.ws.rs.Produces)1 Response (javax.ws.rs.core.Response)1 ResponseUtils.formatResponse (org.commonjava.indy.bind.jaxrs.util.ResponseUtils.formatResponse)1