<commit_before>package io.spacedog.watchdog;

import org.junit.Test;

import io.spacedog.model.Schema;
import io.spacedog.rest.SpaceRequest;
import io.spacedog.rest.SpaceTest;
import io.spacedog.sdk.DataObject;
import io.spacedog.sdk.SpaceDog;

public class LogResourceTestOften extends SpaceTest {

	@Test
	public void doAFewThingsAndGetTheLogs() {

		// prepare
		prepareTest();
		SpaceDog test = resetTestBackend();
		SpaceDog test2 = resetTest2Backend();

		// create message schema in test backend
		test.schema().set(Schema.builder("message").text("text").build());

		// create user in test backend
		SpaceDog user = SpaceDog.backend("test").username("user").signUp("hi user");

		// create a user in test2 backend
		SpaceDog.backend("test2").username("user2").signUp("hi user2");

		// create message in test backend
		DataObject message = user.dataEndpoint().object("message")//
				.node("text", "What's up boys?").save();

		// find message by id in test backend
		message.fetch();

		// find all messages in test backend
		user.dataEndpoint().getAllRequest().type("message").load(DataObject.class);

		// get all test backend logs
		SpaceRequest.get("/1/log").refresh().size(8).auth(test).go(200)//
				.assertSizeEquals(8, "results")//
				.assertEquals("GET", "results.0.method")//<commit_msg>Java sdk data endpoint name has changed<commit_after>package io.spacedog.watchdog;

import org.junit.Test;

import io.spacedog.model.Schema;
import io.spacedog.rest.SpaceRequest;
import io.spacedog.rest.SpaceTest;
import io.spacedog.sdk.DataObject;
import io.spacedog.sdk.SpaceDog;

public class LogResourceTestOften extends SpaceTest {

	@Test
	public void doAFewThingsAndGetTheLogs() {

		// prepare
		prepareTest();
		SpaceDog test = resetTestBackend();
		SpaceDog test2 = resetTest2Backend();

		// create message schema in test backend
		test.schema().set(Schema.builder("message").text("text").build());

		// create user in test backend
		SpaceDog user = SpaceDog.backend("test").username("user").signUp("hi user");

		// create a user in test2 backend
		SpaceDog.backend("test2").username("user2").signUp("hi user2");

		// create message in test backend
		DataObject message = user.data().object("message")//
				.node("text", "What's up boys?").save();

		// find message by id in test backend
		message.fetch();

		// find all messages in test backend
		user.data().getAllRequest().type("message").load(DataObject.class);

		// get all test backend logs
		SpaceRequest.get("/1/log").refresh().size(8).auth(test).go(200)//
				.assertSizeEquals(8, "results")//
				.assertEquals("GET", "results.0.method")//
{'fraction_non_alphanumeric': 0.1524390243902439, 'fraction_numerical': 0.009908536585365854, 'mean_word_length': 4.346232179226069, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4333938', 'n_tokens_mistral': 890, 'n_tokens_neox': 801, 'n_words': 189}