use of org.apache.shenyu.admin.model.entity.MetaDataDO in project incubator-shenyu by apache.
the class ShenyuClientRegisterMotanServiceImplTest method testRegisterMetadata.
@Test
public void testRegisterMetadata() {
MetaDataDO metaDataDO = MetaDataDO.builder().build();
when(metaDataService.findByPath(any())).thenReturn(metaDataDO);
MetaDataRegisterDTO metaDataDTO = MetaDataRegisterDTO.builder().build();
shenyuClientRegisterMotanService.registerMetadata(metaDataDTO);
verify(metaDataService).saveOrUpdateMetaData(metaDataDO, metaDataDTO);
}
use of org.apache.shenyu.admin.model.entity.MetaDataDO in project incubator-shenyu by apache.
the class ShenyuClientRegisterTarsServiceImplTest method testRegisterMetadata.
@Test
public void testRegisterMetadata() {
MetaDataDO metaDataDO = MetaDataDO.builder().build();
String serviceName = "metaDataService";
String methodName = "registerMetadata";
when(metaDataService.findByServiceNameAndMethodName(any(), any())).thenReturn(metaDataDO);
MetaDataRegisterDTO metaDataDTO = MetaDataRegisterDTO.builder().serviceName(serviceName).methodName(methodName).build();
shenyuClientRegisterTarsService.registerMetadata(metaDataDTO);
verify(metaDataService).findByServiceNameAndMethodName(serviceName, methodName);
verify(metaDataService).saveOrUpdateMetaData(metaDataDO, metaDataDTO);
}
use of org.apache.shenyu.admin.model.entity.MetaDataDO in project incubator-shenyu by apache.
the class ShenyuClientRegisterDivideServiceImplTest method testRegisterMetadata.
@Test
public void testRegisterMetadata() {
MetaDataDO metaDataDO = MetaDataDO.builder().build();
when(metaDataService.findByPath(any())).thenReturn(metaDataDO);
MetaDataRegisterDTO metaDataDTO = MetaDataRegisterDTO.builder().registerMetaData(true).build();
shenyuClientRegisterDivideService.registerMetadata(metaDataDTO);
verify(metaDataService).saveOrUpdateMetaData(metaDataDO, metaDataDTO);
}
use of org.apache.shenyu.admin.model.entity.MetaDataDO in project incubator-shenyu by apache.
the class MetaDataServiceTest method testCreateOrUpdateForUpdate.
/**
* Cases where check passed and update operation.<br>
* The stub declared in createOrUpdateCase1 and createOrUpdateCase3 will not be repeated.
*/
private void testCreateOrUpdateForUpdate() {
MetaDataDO metaDataDO = MetaDataDO.builder().build();
when(metaDataDTO.getId()).thenReturn("id");
when(metaDataMapper.selectById("id")).thenReturn(null).thenReturn(metaDataDO);
when(metaDataMapper.update(any())).thenReturn(1);
String msg = metaDataService.createOrUpdate(metaDataDTO);
assertEquals(StringUtils.EMPTY, msg);
}
use of org.apache.shenyu.admin.model.entity.MetaDataDO in project incubator-shenyu by apache.
the class ShenyuClientRegisterSofaServiceImplTest method testRegisterMetadata.
@Test
public void testRegisterMetadata() {
MetaDataDO metaDataDO = MetaDataDO.builder().build();
when(metaDataService.findByServiceNameAndMethodName(any(), any())).thenReturn(metaDataDO);
MetaDataRegisterDTO metaDataDTO = MetaDataRegisterDTO.builder().build();
shenyuClientRegisterSofaService.registerMetadata(metaDataDTO);
verify(metaDataService).saveOrUpdateMetaData(metaDataDO, metaDataDTO);
}
Aggregations