Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRandomLabs committed Mar 14, 2020
1 parent b3ed981 commit 834423e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ protected void appendChangelogEntries(
fileChanges,
fileChange -> Optional.ofNullable(fileChange.project()).
map(CurseProject::name).
orElse("Deleted project (" + fileChange.projectID() + ")"),
orElseGet(() -> "Deleted project (" + fileChange.projectID() + ")"),
this::getChangelogEntries
));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
import com.therandomlabs.changeloggenerator.provider.CurseChangelogProvider;
import com.therandomlabs.curseapi.CurseAPI;
import com.therandomlabs.curseapi.CurseException;
import com.therandomlabs.curseapi.file.BasicCurseFile;
import com.therandomlabs.curseapi.file.CurseFile;
import com.therandomlabs.curseapi.file.CurseFilesComparison;
import com.therandomlabs.curseapi.minecraft.modpack.CurseModpack;
import com.therandomlabs.utils.io.ZipFile;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -76,6 +78,17 @@ public void atm4ChangelogIsValid(@TempDir Path tempDirectory) throws Exception {
BasicChangelogGenerator.instance.generate(oldModpack, newModpack);
assertThat(changelog).isNotEmpty();

final CurseFilesComparison<BasicCurseFile> comparison =
CurseFilesComparison.of(oldModpack.files(), newModpack.files());
final ChangelogEntries entries = BasicChangelogGenerator.instance.getChangelogEntries(
comparison.updated().iterator().next()
);

assertThat(entries).isNotNull();
assertThat(entries.toString()).isNotEmpty();
assertThat(entries.entries()).isNotEmpty();
assertThat(entries.entries().first().toString()).isNotEmpty();

LoggerFactory.getLogger(getClass()).info(changelog);
}
}
Expand Down

0 comments on commit 834423e

Please sign in to comment.