// Path: src/test/java/org/springframework/data/hazelcast/HazelcastUtils.java
// public class HazelcastUtils {
// 
//     static Config hazelcastConfig() {
// 
//         Config hazelcastConfig = new Config();
//         hazelcastConfig.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false);
//         hazelcastConfig.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(false);
//         hazelcastConfig.getNetworkConfig().getJoin().getAwsConfig().setEnabled(false);
// 
//         return hazelcastConfig;
//     }
// 
//     public static HazelcastKeyValueAdapter preconfiguredHazelcastKeyValueAdapter() {
//         HazelcastInstance hazelcastInstance = Hazelcast.newHazelcastInstance(hazelcastConfig());
//         HazelcastKeyValueAdapter hazelcastKeyValueAdapter = new HazelcastKeyValueAdapter(hazelcastInstance);
//         return hazelcastKeyValueAdapter;
//     }
// 
// }
// 
// Path: src/test/java/test/utils/domain/NoIdEntity.java
// @KeySpace
// public class NoIdEntity
//         implements Serializable {
//     private static final long serialVersionUID = 1L;
// 
//     private String name;
// }


import com.hazelcast.core.Hazelcast;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;
import org.springframework.data.hazelcast.HazelcastUtils;
import org.springframework.data.keyvalue.core.KeyValueOperations;
import org.springframework.data.keyvalue.core.KeyValueTemplate;
import org.springframework.data.mapping.MappingException;
import org.springframework.data.mapping.PersistentEntity;
import test.utils.domain.NoIdEntity;
/*
 * Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.springframework.data.hazelcast.repository.support;


public class HazelcastEntityInformationTest {

    private KeyValueOperations operations;

    @Before
    public void setUp() {
        this.operations = new KeyValueTemplate(HazelcastUtils.preconfiguredHazelcastKeyValueAdapter());
    }

    @Test(expected = MappingException.class)
    public void throwsMappingExceptionWhenNoIdPropertyPresent() {
// Path: src/test/java/org/springframework/data/hazelcast/HazelcastUtils.java
// public class HazelcastUtils {
// 
//     static Config hazelcastConfig() {
// 
//         Config hazelcastConfig = new Config();
//         hazelcastConfig.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false);
//         hazelcastConfig.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(false);
//         hazelcastConfig.getNetworkConfig().getJoin().getAwsConfig().setEnabled(false);
// 
//         return hazelcastConfig;
//     }
// 
//     public static HazelcastKeyValueAdapter preconfiguredHazelcastKeyValueAdapter() {
//         HazelcastInstance hazelcastInstance = Hazelcast.newHazelcastInstance(hazelcastConfig());
//         HazelcastKeyValueAdapter hazelcastKeyValueAdapter = new HazelcastKeyValueAdapter(hazelcastInstance);
//         return hazelcastKeyValueAdapter;
//     }
// 
// }
// 
// Path: src/test/java/test/utils/domain/NoIdEntity.java
// @KeySpace
// public class NoIdEntity
//         implements Serializable {
//     private static final long serialVersionUID = 1L;
// 
//     private String name;
// }


// Path: src/test/java/org/springframework/data/hazelcast/repository/support/HazelcastEntityInformationTest.java
import com.hazelcast.core.Hazelcast;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;
import org.springframework.data.hazelcast.HazelcastUtils;
import org.springframework.data.keyvalue.core.KeyValueOperations;
import org.springframework.data.keyvalue.core.KeyValueTemplate;
import org.springframework.data.mapping.MappingException;
import org.springframework.data.mapping.PersistentEntity;
import test.utils.domain.NoIdEntity;

/*
 * Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.springframework.data.hazelcast.repository.support;


public class HazelcastEntityInformationTest {

    private KeyValueOperations operations;

    @Before
    public void setUp() {
        this.operations = new KeyValueTemplate(HazelcastUtils.preconfiguredHazelcastKeyValueAdapter());
    }

    @Test(expected = MappingException.class)
    public void throwsMappingExceptionWhenNoIdPropertyPresent() {
        PersistentEntity<?, ?> persistentEntity = operations.getMappingContext().getPersistentEntity(NoIdEntity.class);