Skip to content

Commit

Permalink
refact: using especific methods
Browse files Browse the repository at this point in the history
  • Loading branch information
artsmandev committed Oct 20, 2023
1 parent 6710497 commit 19d52ac
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void shouldHashCodeBeConditionedToQueryAndParamsAttributes() {
var fistInstance = newInstance(firstQuery, firstParams);
var secondInstance = newInstance(firstQuery, firstParams);

assertThat(fistInstance.hashCode()).isEqualTo(secondInstance.hashCode());
assertThat(fistInstance).hasSameHashCodeAs(secondInstance);

ColumnDeleteQuery secondQuery = newDummyColumnDeleteQuery();
Params secondParams = newDummyParams();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void testToString() {
Scenario scenario = newScenario();
Params params = scenario.params;

assertThat(params.toString()).isEqualTo(String.join(",", scenario.parameterNameList));
assertThat(params).hasToString(String.join(",", scenario.parameterNameList));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ public void shouldEquals(){
public void shouldHashCode(){
ParamQueryValue param = new DefaultQueryValue("name");
ParamQueryValue paramB = new DefaultQueryValue("name");
Assertions.assertThat(param.hashCode()).isEqualTo(paramB.hashCode());
Assertions.assertThat(param).hasSameHashCodeAs(paramB);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,6 @@ public void shouldEqualsHashCode(){
ConstructorBuilder builder = DefaultConstructorBuilder.of(constructor);
ConstructorBuilder other = DefaultConstructorBuilder.of(constructor);
assertThat(builder).isEqualTo(other);
assertThat(builder.hashCode()).isEqualTo(other.hashCode());
assertThat(builder).hasSameHashCodeAs(other);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public void shouldNewInstance(){
public void shouldHashCodeEquals(){
EntityMetadata entityMetadata = converter.apply(Person.class);
assertThat(entityMetadata).isEqualTo(converter.apply(Person.class));
assertThat(entityMetadata.hashCode()).isEqualTo(entityMetadata.hashCode());
assertThat(entityMetadata).hasSameHashCodeAs(entityMetadata);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void shouldToString() {
@Test
public void shouldEqualsHashCode() {
assertThat(fieldMetadata).isEqualTo(fieldMetadata);
assertThat(fieldMetadata.hashCode()).isEqualTo(fieldMetadata.hashCode());
assertThat(fieldMetadata).hasSameHashCodeAs(fieldMetadata);
}

@Test
Expand All @@ -60,4 +60,4 @@ public void shouldCreateNewInstanceConverter(){
AttributeConverter<Object, Object> result = fieldMetadata.newConverter().orElseThrow();
assertThat(result).isNotNull().isInstanceOf(MoneyConverter.class);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void shouldCollectionInstance(){
@Test
public void shouldEqualsHashCode(){
Assertions.assertThat(fieldMetadata).isEqualTo(fieldMetadata);
Assertions.assertThat(fieldMetadata.hashCode()).isEqualTo(fieldMetadata.hashCode());
Assertions.assertThat(fieldMetadata).hasSameHashCodeAs(fieldMetadata);
}

@Test
Expand All @@ -79,4 +79,4 @@ public void shouldConverter(){
public void shouldNewConverter(){
assertThat(fieldMetadata.newConverter()).isNotNull().isEmpty();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public void shouldToString(){
@Test
public void shouldEqualsHasCode(){
Assertions.assertThat(metadata).isEqualTo(metadata);
Assertions.assertThat(metadata.hashCode()).isEqualTo(metadata.hashCode());
Assertions.assertThat(metadata).hasSameHashCodeAs(metadata);
}


}
}

0 comments on commit 19d52ac

Please sign in to comment.