protected EndpointGroupDto generateEndpointGroupDto(String appId, String endpointGroupName) { EndpointGroupDto group = new EndpointGroupDto(); if (isBlank(appId)) { appId = generateApplicationDto(null).getId(); } group.setApplicationId(appId); group.setName(endpointGroupName); group.setWeight(RANDOM.nextInt()); return endpointService.saveEndpointGroup(group); }
@Override protected void onSave() { entity.setName(detailsView.getName().getValue()); entity.setWeight(detailsView.getWeight().getValue()); entity.setDescription(detailsView.getDescription().getValue()); }
protected EndpointGroupDto generateEndpointGroup(String applicationId, String endpointGroupName) { EndpointGroupDto group = new EndpointGroupDto(); if (isBlank(applicationId)) { applicationId = generateApplication(null).getId(); } group.setApplicationId(applicationId); group.setName(endpointGroupName); group.setWeight(random.nextInt()); return endpointService.saveEndpointGroup(group); } }
@Test(expected = IncorrectParameterException.class) public void saveEndpointGroupWithExistingNameTest() { ApplicationDto app = generateApplicationDto(); List<EndpointGroupDto> groups = endpointService.findEndpointGroupsByAppId(app.getId()); Assert.assertFalse(groups.isEmpty()); EndpointGroupDto group = groups.get(0); group.setId(null); group.setWeight(group.getWeight() + 1); endpointService.saveEndpointGroup(group); }
@Override public EndpointGroupDto toDto() { EndpointGroupDto dto = createDto(); dto.setId(getStringId()); dto.setDescription(description); dto.setCreatedUsername(createdUsername); dto.setCreatedTime(createdTime); if (application != null) { dto.setApplicationId(application.getStringId()); } dto.setName(name); dto.setSequenceNumber(sequenceNumber); dto.setWeight(weight); dto.setTopics(getTopicIds(topics)); return dto; }
endpointGroupDto.setWeight(1); cfGroupStateSave.add(new EndpointGroupStateDto("111", null, null)); cfGroupStateSave.add(new EndpointGroupStateDto("222", null, null));
@Test(expected = IncorrectParameterException.class) public void saveEndpointGroupWithSameNameTest() { EndpointGroupDto group = generateEndpointGroupDto(null); EndpointGroupDto found = endpointService.findEndpointGroupById(group.getId()); found.setId(null); found.setWeight(found.getWeight() + 1); endpointService.saveEndpointGroup(found); }
String endpointProfileId = "11"; EndpointGroupDto endpointGroupDto = new EndpointGroupDto(); endpointGroupDto.setWeight(1); cfGroupStateSave.add(new EndpointGroupStateDto("111", null, null)); cfGroupStateSave.add(new EndpointGroupStateDto("222", null, null));