Search in sources :

Example 16 with MetaDataDO

use of org.apache.shenyu.admin.model.entity.MetaDataDO in project incubator-shenyu by apache.

the class MetaDataMapperTest method selectByQuery.

@Test
public void selectByQuery() {
    MetaDataDO metaDataDO = getMetaDataDO();
    int count = metaDataMapper.insert(metaDataDO);
    assertThat(count, comparesEqualTo(1));
    MetaDataQuery metaDataQuery = new MetaDataQuery();
    metaDataQuery.setAppName(metaDataDO.getAppName());
    metaDataQuery.setPageParameter(new PageParameter());
    List<MetaDataDO> result = metaDataMapper.selectByQuery(metaDataQuery);
    assertThat(result.size(), comparesEqualTo(1));
    assertThat(result.get(0).getId(), comparesEqualTo(metaDataDO.getId()));
}
Also used : MetaDataQuery(org.apache.shenyu.admin.model.query.MetaDataQuery) MetaDataDO(org.apache.shenyu.admin.model.entity.MetaDataDO) PageParameter(org.apache.shenyu.admin.model.page.PageParameter) Test(org.junit.jupiter.api.Test) AbstractSpringIntegrationTest(org.apache.shenyu.admin.AbstractSpringIntegrationTest)

Example 17 with MetaDataDO

use of org.apache.shenyu.admin.model.entity.MetaDataDO in project incubator-shenyu by apache.

the class MetaDataMapperTest method findAll.

@Test
public void findAll() {
    MetaDataDO metaDataDO = getMetaDataDO();
    int count = metaDataMapper.insert(metaDataDO);
    assertThat(count, comparesEqualTo(1));
    List<MetaDataDO> result = metaDataMapper.findAll();
    assertThat(result.size(), comparesEqualTo(1));
    assertThat(result.get(0).getId(), comparesEqualTo(metaDataDO.getId()));
}
Also used : MetaDataDO(org.apache.shenyu.admin.model.entity.MetaDataDO) Test(org.junit.jupiter.api.Test) AbstractSpringIntegrationTest(org.apache.shenyu.admin.AbstractSpringIntegrationTest)

Example 18 with MetaDataDO

use of org.apache.shenyu.admin.model.entity.MetaDataDO in project incubator-shenyu by apache.

the class MetaDataMapperTest method selectAll.

@Test
public void selectAll() {
    MetaDataDO metaDataDO = getMetaDataDO();
    int count = metaDataMapper.insert(metaDataDO);
    assertThat(count, comparesEqualTo(1));
    List<MetaDataDO> result = metaDataMapper.selectAll();
    assertThat(result.size(), comparesEqualTo(1));
    assertThat(result.get(0).getId(), comparesEqualTo(metaDataDO.getId()));
}
Also used : MetaDataDO(org.apache.shenyu.admin.model.entity.MetaDataDO) Test(org.junit.jupiter.api.Test) AbstractSpringIntegrationTest(org.apache.shenyu.admin.AbstractSpringIntegrationTest)

Example 19 with MetaDataDO

use of org.apache.shenyu.admin.model.entity.MetaDataDO in project incubator-shenyu by apache.

the class MetaDataMapperTest method findByPath.

@Test
public void findByPath() {
    MetaDataDO metaDataDO = getMetaDataDO();
    int count = metaDataMapper.insert(metaDataDO);
    assertThat(count, comparesEqualTo(1));
    MetaDataDO result = metaDataMapper.findByPath(metaDataDO.getPath());
    assertThat(result.getId(), comparesEqualTo(metaDataDO.getId()));
}
Also used : MetaDataDO(org.apache.shenyu.admin.model.entity.MetaDataDO) Test(org.junit.jupiter.api.Test) AbstractSpringIntegrationTest(org.apache.shenyu.admin.AbstractSpringIntegrationTest)

Example 20 with MetaDataDO

use of org.apache.shenyu.admin.model.entity.MetaDataDO in project incubator-shenyu by apache.

the class MetaDataMapperTest method selectById.

@Test
public void selectById() {
    MetaDataDO metaDataDO = getMetaDataDO();
    int count = metaDataMapper.insert(metaDataDO);
    assertThat(count, comparesEqualTo(1));
    String id = metaDataDO.getId();
    MetaDataDO result = metaDataMapper.selectById(id);
    assertThat(result.getId(), comparesEqualTo(id));
}
Also used : MetaDataDO(org.apache.shenyu.admin.model.entity.MetaDataDO) Test(org.junit.jupiter.api.Test) AbstractSpringIntegrationTest(org.apache.shenyu.admin.AbstractSpringIntegrationTest)

Aggregations

MetaDataDO (org.apache.shenyu.admin.model.entity.MetaDataDO)36 Test (org.junit.jupiter.api.Test)23 AbstractSpringIntegrationTest (org.apache.shenyu.admin.AbstractSpringIntegrationTest)14 MetaDataService (org.apache.shenyu.admin.service.MetaDataService)7 MetaDataRegisterDTO (org.apache.shenyu.register.common.dto.MetaDataRegisterDTO)7 DataChangedEvent (org.apache.shenyu.admin.listener.DataChangedEvent)4 PageParameter (org.apache.shenyu.admin.model.page.PageParameter)3 Timestamp (java.sql.Timestamp)2 MetaDataQuery (org.apache.shenyu.admin.model.query.MetaDataQuery)2 MetaDataVO (org.apache.shenyu.admin.model.vo.MetaDataVO)2 MetaDataTransfer (org.apache.shenyu.admin.transfer.MetaDataTransfer)2 MetaData (org.apache.shenyu.common.dto.MetaData)2 DataEventTypeEnum (org.apache.shenyu.common.enums.DataEventTypeEnum)2 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)2 ArrayList (java.util.ArrayList)1 Transactional (org.springframework.transaction.annotation.Transactional)1