Skip to content
Snippets Groups Projects
Commit 4b7efc3f authored by buczekp's avatar buczekp
Browse files

[LMS-1894] fixed tests (implemented missing equals and hashCodes)

SVN: 18997
parent 6d2ca79c
No related branches found
No related tags found
No related merge requests found
...@@ -311,4 +311,42 @@ public final class Sample extends CodeWithRegistration<Sample> implements IInval ...@@ -311,4 +311,42 @@ public final class Sample extends CodeWithRegistration<Sample> implements IInval
+ ", permId=" + permId + ", permlink=" + permlink + ", searchlink=" + searchlink + ", permId=" + permId + ", permlink=" + permlink + ", searchlink=" + searchlink
+ ", subCode=" + subCode + "]"; + ", subCode=" + subCode + "]";
} }
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
return result;
}
@Override
public boolean equals(Object obj)
{
if (this == obj)
{
return true;
}
if (obj == null)
{
return false;
}
if (!(obj instanceof Sample))
{
return false;
}
Sample other = (Sample) obj;
if (identifier == null)
{
if (other.identifier != null)
{
return false;
}
} else if (!identifier.equals(other.identifier))
{
return false;
}
return true;
}
} }
...@@ -225,7 +225,12 @@ public final class CommonClientServiceTest extends AbstractClientServiceTest ...@@ -225,7 +225,12 @@ public final class CommonClientServiceTest extends AbstractClientServiceTest
@Test @Test
public final void testListSamples() public final void testListSamples()
{ {
List<Sample> entities = Arrays.asList(new Sample()); final Sample sample1 = new Sample();
sample1.setIdentifier("s1");
final Sample sample2 = new Sample();
sample1.setIdentifier("s2");
List<Sample> entities = Arrays.asList(sample1, sample2);
final ListSampleDisplayCriteria criteria = createListCriteria(); final ListSampleDisplayCriteria criteria = createListCriteria();
prepareListEntities(entities, criteria); prepareListEntities(entities, criteria);
// this call is to obtain sample types // this call is to obtain sample types
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment