use of org.onap.namingservice.model.NameGenDeleteRequest in project so by onap.
the class NamingRequestObjectBuilder method nameGenDeleteRequestMapper.
public NameGenDeleteRequest nameGenDeleteRequestMapper(List<Deleteelement> deleteElements) {
NameGenDeleteRequest nameGenDeleteRequest = new NameGenDeleteRequest();
nameGenDeleteRequest.setElements(deleteElements);
return nameGenDeleteRequest;
}
use of org.onap.namingservice.model.NameGenDeleteRequest in project so by onap.
the class NamingServiceResourcesTest method deleteInstanceGroupNameTest.
@Test
public void deleteInstanceGroupNameTest() throws Exception {
NameGenDeleteResponse name = new NameGenDeleteResponse();
ResponseEntity<NameGenDeleteResponse> resp = new ResponseEntity<>(name, null, HttpStatus.OK);
Deleteelement deleteElement = new Deleteelement();
deleteElement.setExternalKey(instanceGroup.getId());
NameGenDeleteRequest req = new NameGenDeleteRequest();
doReturn(deleteElement).when(MOCK_namingRequestObjectBuilder).deleteElementMapper(isA(String.class));
doReturn("").when(MOCK_namingClient).deleteNameGenRequest(isA(NameGenDeleteRequest.class));
doReturn(req).when(MOCK_namingRequestObjectBuilder).nameGenDeleteRequestMapper(isA(List.class));
namingServiceResources.deleteInstanceGroupName(instanceGroup);
verify(MOCK_namingClient, times(1)).deleteNameGenRequest(any(NameGenDeleteRequest.class));
}
use of org.onap.namingservice.model.NameGenDeleteRequest in project so by onap.
the class NamingServiceResourcesTest method deleteServiceInstanceNameTest.
@Test
public void deleteServiceInstanceNameTest() throws Exception {
NameGenDeleteRequest req = new NameGenDeleteRequest();
doReturn(req).when(MOCK_namingRequestObjectBuilder).nameGenDeleteRequestMapper(isA(List.class));
NamingRequestObject nrObject = new NamingRequestObject();
nrObject.setExternalKeyValue("testExternalKey");
nrObject.setNamingTypeValue(NamingServiceConstants.NAMING_TYPE_SERVICE);
namingServiceResources.deleteServiceInstanceName(nrObject);
verify(MOCK_namingClient, times(1)).deleteNameGenRequest(any(NameGenDeleteRequest.class));
}
use of org.onap.namingservice.model.NameGenDeleteRequest in project so by onap.
the class NamingRequestObjectBuilderTest method nameGenDeleteRequestMapper.
@Test
public void nameGenDeleteRequestMapper() {
// Expected NameGenDeleteRequest
NameGenDeleteRequest expected = new NameGenDeleteRequest();
List<Deleteelement> deleteElements = new ArrayList<>();
Deleteelement deleteElement = new Deleteelement();
deleteElement.setExternalKey(instanceGroupId);
deleteElements.add(deleteElement);
expected.setElements(deleteElements);
// Actual NameGenDeleteRequest
NameGenDeleteRequest actual = mapper.nameGenDeleteRequestMapper(deleteElements);
assertThat(actual, sameBeanAs(expected));
}
use of org.onap.namingservice.model.NameGenDeleteRequest in project so by onap.
the class NamingClientIT method unassignSetup.
public NameGenDeleteRequest unassignSetup() throws JsonProcessingException {
NameGenDeleteRequest request = new NameGenDeleteRequest();
List<Deleteelement> deleteElements = new ArrayList<>();
Deleteelement testElement = new Deleteelement();
testElement = requestBuilder.deleteElementMapper("instanceGroupId");
deleteElements.add(testElement);
request = requestBuilder.nameGenDeleteRequestMapper(deleteElements);
return request;
}
Aggregations