<commit_before>package org.apache.isis.persistence.jdo.datanucleus.oid;

import java.util.stream.Stream;

import org.assertj.core.api.Assertions;
import org.datanucleus.identity.DatastoreIdImpl;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;

import org.apache.isis.persistence.jdo.datanucleus.metamodel.facets.entity.IdStringifierForDatastoreIdImpl;

import lombok.val;

class IdStringifierForDatastoreId_DatastoreIdImpl_long_Test {

    public static Stream<Arguments> roundtrip() {
        return Stream.of(
                Arguments.of(1L, "1[OID]org.apache.isis.persistence.jdo.datanucleus.oid.IdStringifierForDatastoreId_DatastoreIdImpl_long_Test$Customer"),
                Arguments.of(0L, null),
                Arguments.of(10L, null),
                Arguments.of(Long.MAX_VALUE, null),
                Arguments.of(Long.MIN_VALUE, null)
        );
    }

    static class Customer {}

    @ParameterizedTest
    @MethodSource()
    void roundtrip(long value, String enstringed) {

        val entityType = Customer.class;

        val stringifier = new IdStringifierForDatastoreIdImpl();

        val stringified = stringifier.enstring(new DatastoreIdImpl(entityType.getName(), value));
        if(enstringed != null) {
            Assertions.assertThat(stringified).isEqualTo(enstringed);
        }
        val parse = stringifier.destring(stringified, entityType);

        Assertions.assertThat(parse.getKeyAsObject()).isEqualTo(value);
        Assertions.assertThat(parse.getTargetClassName()).isEqualTo(entityType.getName());
    }

}
<commit_msg>ISIS-3002: fixes unit test<commit_after>package org.apache.isis.persistence.jdo.datanucleus.oid;

import java.util.stream.Stream;

import org.assertj.core.api.Assertions;
import org.datanucleus.identity.DatastoreIdImpl;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;

import org.apache.isis.persistence.jdo.datanucleus.metamodel.facets.entity.IdStringifierForDatastoreIdImpl;

import lombok.val;

class IdStringifierForDatastoreId_DatastoreIdImpl_long_Test {

    public static Stream<Arguments> roundtrip() {
        return Stream.of(
                Arguments.of(1L, "1"),
                Arguments.of(0L, null),
                Arguments.of(10L, null),
                Arguments.of(Long.MAX_VALUE, null),
                Arguments.of(Long.MIN_VALUE, null)
        );
    }

    static class Customer {}

    @ParameterizedTest
    @MethodSource()
    void roundtrip(long value, String enstringed) {

        val entityType = Customer.class;

        val stringifier = new IdStringifierForDatastoreIdImpl();

        val stringified = stringifier.enstring(new DatastoreIdImpl(entityType.getName(), value));
        if(enstringed != null) {
            Assertions.assertThat(stringified).isEqualTo(enstringed);
        }
        val parse = stringifier.destring(stringified, entityType);

        Assertions.assertThat(parse.getKeyAsObject()).isEqualTo(value);
        Assertions.assertThat(parse.getTargetClassName()).isEqualTo(entityType.getName());
    }

}

{'fraction_non_alphanumeric': 0.10406403940886699, 'fraction_numerical': 0.004310344827586207, 'mean_word_length': 3.4875690607734806, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5050039', 'n_tokens_mistral': 1018, 'n_tokens_neox': 977, 'n_words': 137}