use of org.onap.namingservice.model.Deleteelement in project so by onap.
the class NamingRequestObjectBuilder method deleteElementMapper.
public Deleteelement deleteElementMapper(String instanceGroupId) {
Deleteelement deleteElement = new Deleteelement();
deleteElement.setExternalKey(instanceGroupId);
return deleteElement;
}
use of org.onap.namingservice.model.Deleteelement 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.Deleteelement 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.Deleteelement 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;
}
use of org.onap.namingservice.model.Deleteelement in project so by onap.
the class NamingRequestObjectBuilderTest method deleteElementMapperTest.
@Test
public void deleteElementMapperTest() {
// Expected Deleteelement
Deleteelement expected = new Deleteelement();
expected.setExternalKey(instanceGroupId);
// Actual Deleteelement
Deleteelement actual = mapper.deleteElementMapper(instanceGroupId);
assertThat(actual, sameBeanAs(expected));
}
Aggregations