@Test public void get_resource_path_and_module_key() { setupData("fixture"); ResourceDto dir = dao.getResource(3L); assertThat(dir.getPath()).isEqualTo("src/org/struts"); ResourceDto file = dao.getResource(4L); assertThat(file.getPath()).isEqualTo("src/org/struts/RequestContext.java"); }
public static ComponentDto toComponent(ResourceDto resourceDto) { return new ComponentDto() .setId(resourceDto.getId()) .setKey(resourceDto.getKey()) .setPath(resourceDto.getPath()) .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(); }