@Test public void replacesNullWithEmptyList_WhenResponseHasNoChildren() throws Exception { RepositoryFileTreeDto returned = prepareReturnedDto( null ); WebResource resource = mockWebResource( returned ); when( client.resource( anyString() ) ).thenReturn( resource ); List<RepositoryFileTreeDto> children = proxy.getChildren(); assertTrue( children.isEmpty() ); }
public List<RepositoryFileTreeDto> getChildren() { List<RepositoryFileTreeDto> children = dto.getChildren(); if ( children == null ) { synchronized ( this ) { children = dto.getChildren(); if ( children == null ) { children = loadChildren( dto.getFile().getPath() ); dto.setChildren( children ); } } } return children; }
RepositoryFileTreeDtoProxy extends RepositoryFileTreeDto { public List<RepositoryFileTreeDto> getChildren() { List<RepositoryFileTreeDto> children = dto.getChildren(); if ( children == null ) { synchronized ( this ) { children = dto.getChildren(); if ( children == null ) { children = loadChildren( dto.getFile().getPath() ); dto.setChildren( children ); } } } return children; } }
RepositoryFileTreeDtoProxy extends RepositoryFileTreeDto { public List<RepositoryFileTreeDto> getChildren() { List<RepositoryFileTreeDto> children = dto.getChildren(); if ( children == null ) { synchronized ( this ) { children = dto.getChildren(); if ( children == null ) { children = loadChildren( dto.getFile().getPath() ); dto.setChildren( children ); } } } return children; } RepositoryFileTreeDtoProxy( RepositoryFileTreeDto dto, Client client, String baseUrl ); }
RepositoryFileTreeDtoProxy extends RepositoryFileTreeDto { public List<RepositoryFileTreeDto> getChildren() { List<RepositoryFileTreeDto> children = dto.getChildren(); if ( children == null ) { synchronized ( this ) { children = dto.getChildren(); if ( children == null ) { children = loadChildren( dto.getFile().getPath() ); dto.setChildren( children ); } } } return children; } RepositoryFileTreeDtoProxy( RepositoryFileTreeDto dto, Client client, String baseUrl ); List<RepositoryFileTreeDto> getChildren(); RepositoryFileDto getFile(); void setFile( final RepositoryFileDto file ); void setChildren( final List<RepositoryFileTreeDto> children ); RepositoryFileTreeDto getRealObject(); }
RepositoryFileTreeDtoProxy extends RepositoryFileTreeDto { public List<RepositoryFileTreeDto> getChildren() { List<RepositoryFileTreeDto> children = dto.getChildren(); if ( children == null ) { synchronized ( this ) { children = dto.getChildren(); if ( children == null ) { children = loadChildren( dto.getFile().getPath() ); dto.setChildren( children ); } } } return children; } RepositoryFileTreeDtoProxy( RepositoryFileTreeDto dto, Client client, String baseUrl ); List<RepositoryFileTreeDto> getChildren(); RepositoryFileDto getFile(); void setFile( final RepositoryFileDto file ); void setChildren( final List<RepositoryFileTreeDto> children ); RepositoryFileTreeDto getRealObject();  }