use of com.alibaba.nacos.config.server.model.capacity.GroupCapacity in project nacos by alibaba.
the class GroupCapacityPersistServiceTest method testGetClusterCapacity.
@Test
public void testGetClusterCapacity() {
List<GroupCapacity> list = new ArrayList<>();
GroupCapacity groupCapacity = new GroupCapacity();
groupCapacity.setId(1L);
list.add(groupCapacity);
String groupId = GroupCapacityPersistService.CLUSTER;
when(jdbcTemplate.query(anyString(), eq(new Object[] { groupId }), any(RowMapper.class))).thenReturn(list);
Capacity ret = service.getClusterCapacity();
Assert.assertEquals(groupCapacity.getId(), ret.getId());
}
use of com.alibaba.nacos.config.server.model.capacity.GroupCapacity in project nacos by alibaba.
the class GroupCapacityPersistServiceTest method testIncrementUsage.
@Test
public void testIncrementUsage() {
GroupCapacity groupCapacity = new GroupCapacity();
Timestamp timestamp = new Timestamp(System.currentTimeMillis());
groupCapacity.setGmtModified(timestamp);
groupCapacity.setGroup("test3");
when(jdbcTemplate.update(anyString(), eq(timestamp), eq("test3"))).thenReturn(1);
Assert.assertTrue(service.incrementUsage(groupCapacity));
}
Aggregations