I was asked to file a bug by the tool. It appeared twice, I post both here.
home/runner/work/jabref/jabref/src/test/java/org/jabref/http/server/LibraryResourceTest.java:error: Something has gone terribly wrong. We planned to make the below formatting change, but have aborted because it would unexpectedly change the AST.
Please file a bug: https://github.com/google/google-java-format/issues/new
=== Actual: ===
package org.jabref.http.server;
import org.jabref.http.JabrefMediaType;
import jakarta.ws.rs.core.Application;
import org.glassfish.jersey.server.ResourceConfig;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
class LibraryResourceTest extends ServerTest {
@Override
protected Application configure() {
ResourceConfig resourceConfig = new ResourceConfig(LibraryResource.class, LibrariesResource.class);
addPreferencesToResourceConfig(resourceConfig);
addGsonToResourceConfig(resourceConfig);
return resourceConfig.getApplication();
}
@Test
void getJson() {
assertEquals("@Misc{Author2023test,\n author = {Demo Author},\n title = {Demo Title},\n year = {2023},\n}\n\n@Comment{jabref-meta: databaseType:bibtex;}\n", target("/libraries/" + TestBibFile.GENERAL_SERVER_TEST.id).request(JabrefMediaType.BIBTEX).get(String.class));
}
@Test
void getClsItemJson() {
assertEquals(" \"\n+ \" [{\"id\":\"Author2023test\",\"type\":\"article\",\"author\":[{\"family\":\"Author\",\"given\":\"Demo\"}],\"event-date\":{\"date-parts\":[[2023]]},\"issued\":{\"date-parts\":[[2023]]},\"title\":\"Demo\"\n+ \" Title\"}]", target("/libraries/" + TestBibFile.GENERAL_SERVER_TEST.id).request(JabrefMediaType.JSON_CSL_ITEM).get(String.class));
}
}
=== Expected: ===
package org.jabref.http.server;
import org.jabref.http.JabrefMediaType;
import jakarta.ws.rs.core.Application;
import org.glassfish.jersey.server.ResourceConfig;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
class LibraryResourceTest extends ServerTest {
@Override
protected Application configure() {
ResourceConfig resourceConfig = new ResourceConfig(LibraryResource.class, LibrariesResource.class);
addPreferencesToResourceConfig(resourceConfig);
addGsonToResourceConfig(resourceConfig);
return resourceConfig.getApplication();
}
@Test
void getJson() {
assertEquals("@Misc{Author2023test,\n author = {Demo Author},\n title = {Demo Title},\n year = {2023},\n}\n\n@Comment{jabref-meta: databaseType:bibtex;}\n", target("/libraries/" + TestBibFile.GENERAL_SERVER_TEST.id).request(JabrefMediaType.BIBTEX).get(String.class));
}
@Test
void getClsItemJson() {
assertEquals("[{\"id\":\"Author2023test\",\"type\":\"article\",\"author\":[{\"family\":\"Author\",\"given\":\"Demo\"}],\"event-date\":{\"date-parts\":[[2023]]},\"issued\":{\"date-parts\":[[2023]]},\"title\":\"Demo Title\"}]", target("/libraries/" + TestBibFile.GENERAL_SERVER_TEST.id).request(JabrefMediaType.JSON_CSL_ITEM).get(String.class));
}
}
/home/runner/work/jabref/jabref/src/test/java/org/jabref/logic/citationstyle/JabRefItemDataProviderTest.java:error: Something has gone terribly wrong. We planned to make the below formatting change, but have aborted because it would unexpectedly change the AST.
Please file a bug: https://github.com/google/google-java-format/issues/new
=== Actual: ===
package org.jabref.logic.citationstyle;
import java.util.List;
import org.jabref.model.database.BibDatabase;
import org.jabref.model.database.BibDatabaseContext;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.BibEntryTypesManager;
import org.jabref.model.entry.field.StandardField;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
class JabRefItemDataProviderTest {
@Test
void toJsonOneEntry() {
BibDatabase bibDatabase = new BibDatabase(List.of(new BibEntry().withCitationKey("key").withField(StandardField.AUTHOR, "Test Author")));
BibDatabaseContext bibDatabaseContext = new BibDatabaseContext(bibDatabase);
JabRefItemDataProvider jabRefItemDataProvider = new JabRefItemDataProvider();
jabRefItemDataProvider.setData(bibDatabaseContext, new BibEntryTypesManager());
assertEquals(" \"\n+ \" [{\"id\":\"key\",\"type\":\"article\",\"author\":[{\"family\":\"Author\",\"given\":\"Test\"}]}]", jabRefItemDataProvider.toJson());
}
@Test
void toJsonTwoEntries() {
BibDatabase bibDatabase = new BibDatabase(List.of(new BibEntry().withCitationKey("key").withField(StandardField.AUTHOR, "Test Author"), new BibEntry().withCitationKey("key2").withField(StandardField.AUTHOR, "Second Author")));
BibDatabaseContext bibDatabaseContext = new BibDatabaseContext(bibDatabase);
JabRefItemDataProvider jabRefItemDataProvider = new JabRefItemDataProvider();
jabRefItemDataProvider.setData(bibDatabaseContext, new BibEntryTypesManager());
assertEquals(" \"\n+ \" [{\"id\":\"key\",\"type\":\"article\",\"author\":[{\"family\":\"Author\",\"given\":\"Test\"}]},{\"id\":\"key2\",\"type\":\"article\",\"author\":[{\"family\":\"Author\",\"given\":\"Second\"}]}]", jabRefItemDataProvider.toJson());
}
}
=== Expected: ===
package org.jabref.logic.citationstyle;
import java.util.List;
import org.jabref.model.database.BibDatabase;
import org.jabref.model.database.BibDatabaseContext;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.BibEntryTypesManager;
import org.jabref.model.entry.field.StandardField;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
class JabRefItemDataProviderTest {
@Test
void toJsonOneEntry() {
BibDatabase bibDatabase = new BibDatabase(List.of(new BibEntry().withCitationKey("key").withField(StandardField.AUTHOR, "Test Author")));
BibDatabaseContext bibDatabaseContext = new BibDatabaseContext(bibDatabase);
JabRefItemDataProvider jabRefItemDataProvider = new JabRefItemDataProvider();
jabRefItemDataProvider.setData(bibDatabaseContext, new BibEntryTypesManager());
assertEquals("[{\"id\":\"key\",\"type\":\"article\",\"author\":[{\"family\":\"Author\",\"given\":\"Test\"}]}]", jabRefItemDataProvider.toJson());
}
@Test
void toJsonTwoEntries() {
BibDatabase bibDatabase = new BibDatabase(List.of(new BibEntry().withCitationKey("key").withField(StandardField.AUTHOR, "Test Author"), new BibEntry().withCitationKey("key2").withField(StandardField.AUTHOR, "Second Author")));
BibDatabaseContext bibDatabaseContext = new BibDatabaseContext(bibDatabase);
JabRefItemDataProvider jabRefItemDataProvider = new JabRefItemDataProvider();
jabRefItemDataProvider.setData(bibDatabaseContext, new BibEntryTypesManager());
assertEquals("[{\"id\":\"key\",\"type\":\"article\",\"author\":[{\"family\":\"Author\",\"given\":\"Test\"}]},{\"id\":\"key2\",\"type\":\"article\",\"author\":[{\"family\":\"Author\",\"given\":\"Second\"}]}]", jabRefItemDataProvider.toJson());
}
}
I was asked to file a bug by the tool. It appeared twice, I post both here.
home/runner/work/jabref/jabref/src/test/java/org/jabref/http/server/LibraryResourceTest.java:error: Something has gone terribly wrong. We planned to make the below formatting change, but have aborted because it would unexpectedly change the AST.
Please file a bug: https://github.com/google/google-java-format/issues/new
=== Actual: ===
=== Expected: ===
/home/runner/work/jabref/jabref/src/test/java/org/jabref/logic/citationstyle/JabRefItemDataProviderTest.java:error: Something has gone terribly wrong. We planned to make the below formatting change, but have aborted because it would unexpectedly change the AST.
Please file a bug: https://github.com/google/google-java-format/issues/new
=== Actual: ===
=== Expected: ===