// Path: koper-testcase/src/main/java/koper/demo/member/mapper/Member.java
// public class Member {
// 
//     private Integer id;
// 
//     private String name;
// 
//     private String phone;
// 
//     public Integer getId() {
//         return id;
//     }
// 
//     public void setId(Integer id) {
//         this.id = id;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public String getPhone() {
//         return phone;
//     }
// 
//     public void setPhone(String phone) {
//         this.phone = phone;
//     }
// 
//     @Override
//     public String toString() {
//         return "Member{" +
//                 "id=" + id +
//                 ", name='" + name + '\'' +
//                 ", phone='" + phone + '\'' +
//                 '}';
//     }
// }
// 
// Path: koper-testcase/src/main/java/koper/demo/member/mapper/MemberMapper.java
// public interface MemberMapper {
// 
//     String insertMember(Integer id, String name, String phone);
// 
//     String cancelMember(Integer id, Member member);
// 
//     String deleteMember(Integer id, String name);
// 
//     String updateMember(Double id, Long name, BigDecimal account);
// 
//     String insertWithFloatAndShortAndByteAndChar(Float fl, Short s, Byte b, Character c);
// 
//     String deleteWithIntegerAndStringAndDataEvent(Integer id, String name);
// 
// 
// }


import koper.demo.member.mapper.Member;
import koper.demo.member.mapper.MemberMapper;
import org.junit.Test;
import org.springframework.test.AbstractDependencyInjectionSpringContextTests;
import java.math.BigDecimal;
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You 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 koper.kafka.databind;



/**
 * 对应的 Listener 为 MemberListener
 *
 * @author caie
 * @since 1.2
 * 2016年8月5日
 */
public class DataEventDataBindTestCase extends AbstractDependencyInjectionSpringContextTests {

    private MemberMapper memberMapper;

    public void setOrderMapper(MemberMapper memberMapper) {
        this.memberMapper = memberMapper;
    }

    @Override
    protected String[] getConfigLocations() {
        return new String[]{"kafka/context-data-message.xml",
                "kafka/context-data-producer.xml"
        };
    }

    @Test
    public void testInsertMember() {

        final Integer id = 1;
        final String name = "test_name";
        final String phone = "15397300000";

        memberMapper.insertMember(id, name, phone);
    }

    @Test
    public void testCancelMember() {

        final Integer id = 1;
// Path: koper-testcase/src/main/java/koper/demo/member/mapper/Member.java
// public class Member {
// 
//     private Integer id;
// 
//     private String name;
// 
//     private String phone;
// 
//     public Integer getId() {
//         return id;
//     }
// 
//     public void setId(Integer id) {
//         this.id = id;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public String getPhone() {
//         return phone;
//     }
// 
//     public void setPhone(String phone) {
//         this.phone = phone;
//     }
// 
//     @Override
//     public String toString() {
//         return "Member{" +
//                 "id=" + id +
//                 ", name='" + name + '\'' +
//                 ", phone='" + phone + '\'' +
//                 '}';
//     }
// }
// 
// Path: koper-testcase/src/main/java/koper/demo/member/mapper/MemberMapper.java
// public interface MemberMapper {
// 
//     String insertMember(Integer id, String name, String phone);
// 
//     String cancelMember(Integer id, Member member);
// 
//     String deleteMember(Integer id, String name);
// 
//     String updateMember(Double id, Long name, BigDecimal account);
// 
//     String insertWithFloatAndShortAndByteAndChar(Float fl, Short s, Byte b, Character c);
// 
//     String deleteWithIntegerAndStringAndDataEvent(Integer id, String name);
// 
// 
// }


// Path: koper-testcase/src/test/java/koper/kafka/databind/DataEventDataBindTestCase.java
import koper.demo.member.mapper.Member;
import koper.demo.member.mapper.MemberMapper;
import org.junit.Test;
import org.springframework.test.AbstractDependencyInjectionSpringContextTests;
import java.math.BigDecimal;

/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You 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 koper.kafka.databind;



/**
 * 对应的 Listener 为 MemberListener
 *
 * @author caie
 * @since 1.2
 * 2016年8月5日
 */
public class DataEventDataBindTestCase extends AbstractDependencyInjectionSpringContextTests {

    private MemberMapper memberMapper;

    public void setOrderMapper(MemberMapper memberMapper) {
        this.memberMapper = memberMapper;
    }

    @Override
    protected String[] getConfigLocations() {
        return new String[]{"kafka/context-data-message.xml",
                "kafka/context-data-producer.xml"
        };
    }

    @Test
    public void testInsertMember() {

        final Integer id = 1;
        final String name = "test_name";
        final String phone = "15397300000";

        memberMapper.insertMember(id, name, phone);
    }

    @Test
    public void testCancelMember() {

        final Integer id = 1;
        Member member = new Member();