Skip to content

Commit df10d00

Browse files
refactor: fix toString method
1 parent 22713e8 commit df10d00

1 file changed

Lines changed: 30 additions & 8 deletions

File tree

src/test/java/org/eclipse/keyple/card/calypso/TestDtoAdapters.java

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
import java.util.Arrays;
1515
import java.util.List;
16-
import org.eclipse.keyple.core.util.json.JsonUtil;
16+
import org.eclipse.keyple.core.util.HexUtil;
1717
import org.eclipse.keypop.card.ApduResponseApi;
1818
import org.eclipse.keypop.card.CardResponseApi;
1919
import org.eclipse.keypop.card.CardSelectionResponseApi;
@@ -57,15 +57,16 @@ public int getStatusWord() {
5757
return statusWord;
5858
}
5959

60-
/**
61-
* Converts the APDU response into a string where the data is encoded in a json format.
62-
*
63-
* @return A not empty String
64-
* @since 2.0.0
65-
*/
6660
@Override
6761
public String toString() {
68-
return "APDU_RESPONSE = " + JsonUtil.toJson(this);
62+
return "ApduResponseAdapter{"
63+
+ "apdu='"
64+
+ HexUtil.toHex(apdu)
65+
+ '\''
66+
+ ", statusWord='"
67+
+ HexUtil.toHex(statusWord)
68+
+ '\''
69+
+ '}';
6970
}
7071

7172
@Override
@@ -132,6 +133,16 @@ public boolean isLogicalChannelOpen() {
132133
return isLogicalChannelOpen;
133134
}
134135

136+
@Override
137+
public String toString() {
138+
return "CardResponseAdapter{"
139+
+ "apduResponses="
140+
+ apduResponses
141+
+ ", isLogicalChannelOpen="
142+
+ isLogicalChannelOpen
143+
+ '}';
144+
}
145+
135146
@Override
136147
public boolean equals(Object o) {
137148
if (this == o) return true;
@@ -183,5 +194,16 @@ public boolean hasMatched() {
183194
public CardResponseApi getCardResponse() {
184195
throw new UnsupportedOperationException("hasMatched");
185196
}
197+
198+
@Override
199+
public String toString() {
200+
return "CardSelectionResponseAdapter{"
201+
+ "powerOnData='"
202+
+ powerOnData
203+
+ '\''
204+
+ ", selectApplicationResponse="
205+
+ selectApplicationResponse
206+
+ '}';
207+
}
186208
}
187209
}

0 commit comments

Comments
 (0)