public static ComponentDto toComponent(ResourceDto resourceDto) { return new ComponentDto() .setId(resourceDto.getId()) .setKey(resourceDto.getKey()) .setLongName(resourceDto.getLongName()) .setName(resourceDto.getName()) .setQualifier(resourceDto.getQualifier()); }
@Test public void get_resource_by_uuid() { dbTester.prepareDbUnit(getClass(), "fixture.xml"); ResourceDto resource = underTest.selectResource("ABCD"); assertThat(resource.getUuid()).isEqualTo("ABCD"); assertThat(resource.getProjectUuid()).isEqualTo("ABCD"); assertThat(resource.getPath()).isNull(); assertThat(resource.getName()).isEqualTo("Struts"); assertThat(resource.getLongName()).isEqualTo("Apache Struts"); assertThat(resource.getScope()).isEqualTo("PRJ"); assertThat(resource.getDescription()).isEqualTo("the description"); assertThat(resource.getLanguage()).isEqualTo("java"); assertThat(resource.isEnabled()).isTrue(); assertThat(resource.getAuthorizationUpdatedAt()).isNotNull(); assertThat(resource.getCreatedAt()).isNotNull(); }
@Test public void get_resource_by_id() { setupData("fixture"); ResourceDto resource = dao.getResource(1L); assertThat(resource.getUuid()).isEqualTo("ABCD"); assertThat(resource.getProjectUuid()).isEqualTo("ABCD"); assertThat(resource.getPath()).isNull(); assertThat(resource.getName()).isEqualTo("Struts"); assertThat(resource.getLongName()).isEqualTo("Apache Struts"); assertThat(resource.getScope()).isEqualTo("PRJ"); assertThat(resource.getDescription()).isEqualTo("the description"); assertThat(resource.getLanguage()).isEqualTo("java"); assertThat(resource.isEnabled()).isTrue(); assertThat(resource.getAuthorizationUpdatedAt()).isNotNull(); assertThat(resource.getCreatedAt()).isNotNull(); }