<commit_before>package org.jvalue.ceps.notifications.sender; 

public final class NotificationSenderTest {

	/*
	@Test
	public final void testSuccessResult() {

		DummyNotificationSender sender = new DummyNotificationSender();

		SenderResult success = sender.getSuccessResult();
		assertNotNull(success);
		assertEquals(success.getStatus(), SenderResult.Status.SUCCESS);
		assertNull(success.getRemoveDeviceId());
		assertNull(success.getUpdateDeviceId());
		assertNull(success.getErrorMsg());
		assertNull(success.getErrorCause());

	}


	@Test
	public final void testErrorMsgResult() {

		DummyNotificationSender sender = new DummyNotificationSender();

		SenderResult error = sender.getErrorResult("error");
		assertNotNull(error);
		assertEquals(error.getStatus(), SenderResult.Status.ERROR);
		assertEquals(error.getErrorMsg(), "error");
		assertNull(error.getRemoveDeviceId());
		assertNull(error.getUpdateDeviceId());
		assertNull(error.getErrorCause());

	}


	@Test
	public final void testErrorCauseResult() {

		DummyNotificationSender sender = new DummyNotificationSender();
		Exception exception = new RuntimeException("error");

		SenderResult error = sender.getErrorResult(exception);
		assertNotNull(error);
		assertEquals(error.getStatus(), SenderResult.Status.ERROR);
		assertEquals(error.getErrorCause(), exception);
		assertNull(error.getRemoveDeviceId());
		assertNull(error.getUpdateDeviceId());
		assertNull(error.getErrorMsg());

	}


	@Test
	public final void testClientResults() {

		DummyNotificationSender sender = new DummyNotificationSender();

		String oldDeviceId = "idOld";
		String newDeviceId = "idNew";

		SenderResult result = sender.getRemoveClientResult(oldDeviceId);
		assertNotNull(result);
		assertEquals(SenderResult.Status.REMOVE_CLIENT, result.getStatus());
		assertEquals(oldDeviceId, result.getRemoveDeviceId());
		assertNull(result.getUpdateDeviceId());
		assertNull(result.getErrorCause());
		assertNull(result.getErrorMsg());

		result = sender.getUpdateClientResult(oldDeviceId, newDeviceId);
		assertNotNull(result);
		assertEquals(SenderResult.Status.UPDATE_CLIENT, result.getStatus());
		assertNull(result.getRemoveDeviceId());
		assertEquals(oldDeviceId, result.getUpdateDeviceId().first);
		assertEquals(newDeviceId, result.getUpdateDeviceId().second);
		assertNull(result.getErrorCause());
		assertNull(result.getErrorMsg());

	}

	*/
}<commit_msg>test: updated NotificationSenderTest<commit_after>package org.jvalue.ceps.notifications.sender;

import com.fasterxml.jackson.databind.JsonNode;

import org.junit.Assert;
import org.junit.Test;
import org.jvalue.ceps.notifications.clients.Client;

import java.util.List;

public final class NotificationSenderTest {

	private final NotificationSender<Client> sender = new DummyNotificationSender();

	@Test
	public final void testSuccessResult() {
		SenderResult success = sender.getSuccessResult();
		Assert.assertNotNull(success);
		Assert.assertEquals(success.getStatus(), SenderResult.Status.SUCCESS);
		Assert.assertNull(success.getRemoveDeviceId());
		Assert.assertNull(success.getUpdateDeviceId());
		Assert.assertNull(success.getErrorMsg());
		Assert.assertNull(success.getErrorCause());

	}


	@Test
	public final void testErrorMsgResult() {
		SenderResult error = sender.getErrorResult("error");
		Assert.assertNotNull(error);
		Assert.assertEquals(error.getStatus(), SenderResult.Status.ERROR);
		Assert.assertEquals(error.getErrorMsg(), "error");
		Assert.assertNull(error.getRemoveDeviceId());
		Assert.assertNull(error.getUpdateDeviceId());
		Assert.assertNull(error.getErrorCause());

	}


	@Test
	public final void testErrorCauseResult() {
		Exception exception = new RuntimeException("error");
		SenderResult error = sender.getErrorResult(exception);
		Assert.assertNotNull(error);
		Assert.assertEquals(error.getStatus(), SenderResult.Status.ERROR);
		Assert.assertEquals(error.getErrorCause(), exception);
		Assert.assertNull(error.getRemoveDeviceId());
		Assert.assertNull(error.getUpdateDeviceId());
		Assert.assertNull(error.getErrorMsg());
	}


	@Test
	public final void testClientResults() {
		String oldDeviceId = "idOld";
		String newDeviceId = "idNew";

		SenderResult result = sender.getRemoveClientResult(oldDeviceId);
		Assert.assertNotNull(result);
		Assert.assertEquals(SenderResult.Status.REMOVE_CLIENT, result.getStatus());
		Assert.assertEquals(oldDeviceId, result.getRemoveDeviceId());
		Assert.assertNull(result.getUpdateDeviceId());
		Assert.assertNull(result.getErrorCause());
		Assert.assertNull(result.getErrorMsg());

		result = sender.getUpdateClientResult(oldDeviceId, newDeviceId);
		Assert.assertNotNull(result);
		Assert.assertEquals(SenderResult.Status.UPDATE_CLIENT, result.getStatus());
		Assert.assertNull(result.getRemoveDeviceId());
		Assert.assertEquals(oldDeviceId, result.getUpdateDeviceId().first);
		Assert.assertEquals(newDeviceId, result.getUpdateDeviceId().second);
		Assert.assertNull(result.getErrorCause());
		Assert.assertNull(result.getErrorMsg());

	}


	private static final class DummyNotificationSender extends NotificationSender<Client> {

		@Override
		public SenderResult sendEventUpdate(
				Client client,
				String eventId,
				List<JsonNode> newEvents,
				List<JsonNode> oldEvents) {

			return null;
		}

	}

}
{'fraction_non_alphanumeric': 0.11879131255901794, 'fraction_numerical': 0.0, 'mean_word_length': 6.6531791907514455, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, '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': '4233235', 'n_tokens_mistral': 1628, 'n_tokens_neox': 1468, 'n_words': 239}