Skip to content

Commit

Permalink
Merge pull request #16 from jitwxs/dev
Browse files Browse the repository at this point in the history
1.16-RELEASE
  • Loading branch information
jitwxs committed Apr 11, 2023
2 parents 8d3331a + 037e0a0 commit 4cd2b1f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion easydata-sample/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<dependency>
<groupId>io.github.jitwxs</groupId>
<artifactId>easydata</artifactId>
<version>1.15-RELEASE</version>
<version>1.16-RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void testAgronaKMap() {
@Test
@DisplayName("agrona | value map")
public void testAgronaVMap() {
final Supplier<MockConfig> mockConfigSupplier = () -> new MockConfig().registerConstructorSupplier(() -> new Object2IntHashMap(-1));
final Supplier<MockConfig> mockConfigSupplier = () -> new MockConfig().registerConstructorSupplier(Object2IntHashMap.class, () -> new Object2IntHashMap(-1));

// initial with TypeKit
final Object2IntHashMap<String> map = assertDoesNotThrow(() -> EasyMock.run(new TypeKit<Object2IntHashMap<String>>() {
Expand All @@ -54,7 +54,7 @@ public void testAgronaVMap() {
@Test
@DisplayName("agrona | key-value map")
public void testAgronaKVMap() {
final Supplier<MockConfig> mockConfigSupplier = () -> new MockConfig().registerConstructorSupplier(() -> new Long2LongHashMap(-1));
final Supplier<MockConfig> mockConfigSupplier = () -> new MockConfig().registerConstructorSupplier(Long2LongHashMap.class, () -> new Long2LongHashMap(-1));

// initial with TypeKit
final Long2LongHashMap map = assertDoesNotThrow(() -> EasyMock.run(new TypeKit<Long2LongHashMap>() {
Expand Down
2 changes: 1 addition & 1 deletion easydata/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.github.jitwxs</groupId>
<artifactId>easydata</artifactId>
<version>1.15-RELEASE</version>
<version>1.16-RELEASE</version>
<packaging>jar</packaging>

<name>easydata</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,12 @@ public <T> MockConfig registerBeanMockerInterceptor(Class<T> clazz, BeanMockInte
/**
* 手动指定构造器方法
*
* @param target target
* @param constructorSupplier 构造器初始化方法
* @return mockConfig instance in chain invoke
*/
public MockConfig registerConstructorSupplier(Supplier<?> constructorSupplier) {
this.constructorSupplierMap.put(constructorSupplier.get().getClass(), constructorSupplier);
public MockConfig registerConstructorSupplier(final Class<?> target, Supplier<?> constructorSupplier) {
this.constructorSupplierMap.put(target, constructorSupplier);

return this;
}
Expand Down

0 comments on commit 4cd2b1f

Please sign in to comment.