service.createComponent(componentKey, componentName, qualifier);
ArgumentCaptor<ResourceDto> resourceCaptor = ArgumentCaptor.forClass(ResourceDto.class);
verify(resourceDao).insertOrUpdate(resourceCaptor.capture());
ResourceDto created = resourceCaptor.getValue();
assertThat(created.getUuid()).isNotNull();
assertThat(created.getProjectUuid()).isEqualTo(created.getUuid());
assertThat(created.getKey()).isEqualTo(componentKey);
assertThat(created.getName()).isEqualTo(componentName);
assertThat(created.getLongName()).isEqualTo(componentName);
assertThat(created.getScope()).isEqualTo(Scopes.PROJECT);
assertThat(created.getQualifier()).isEqualTo(qualifier);
verify(resourceDao, times(2)).findByKey(componentKey);
verify(resourceIndexerDao).indexResource(componentId);
}