Skip to content
This repository was archived by the owner on Jun 28, 2024. It is now read-only.

Commit 81cc56e

Browse files
committed
fix meetup response
1 parent 100bd41 commit 81cc56e

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

lib/src/main/java/com/puncty/lib/MeetupCollection.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public MeetupCollection(Session s) {
1919
this.session = s;
2020
}
2121

22-
public Meetup create(long timestamp, String location) throws BrokenResponse {
22+
public String create(long timestamp, String location) throws BrokenResponse {
2323
var path = "/meetup";
2424

2525
var data = new HashMap<String, String>();
@@ -28,8 +28,8 @@ public Meetup create(long timestamp, String location) throws BrokenResponse {
2828

2929
var resp = this.session.post(path, data);
3030
try {
31-
return Meetup.fromJSON(this.session, resp.json.get());
32-
} catch (JSONException e) {
31+
return resp.text;
32+
} catch (Exception e) {
3333
throw new BrokenResponse("POST", path);
3434
}
3535
}
@@ -38,10 +38,10 @@ public Meetup create(long timestamp, String location) throws BrokenResponse {
3838
* create a new meetup
3939
* @param datetime when will the meetup take place
4040
* @param location where will the meetup take place
41-
* @return the new meetup
41+
* @return the id of the new meetup
4242
* @throws BrokenResponse if something unexpected goes wrong
4343
*/
44-
public Meetup create(Date datetime, String location) throws BrokenResponse {
44+
public String create(Date datetime, String location) throws BrokenResponse {
4545
return this.create(datetime.getTime(), location);
4646
}
4747

lib/src/test/java/com/puncty/lib/MeetupCollectionTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ public class MeetupCollectionTest {
2222
@Test
2323
public void createMeetup() throws BrokenResponse {
2424
r.mockPost("/meetup",
25-
new RequesterResponse(200, MOCK_MEETUP_JSON)
25+
new RequesterResponse(200, "12345")
2626
);
2727

2828
var m = mc.create(1234, "Park");
29-
meetupAssertions(m);
29+
assertTrue(m.equals("12345"));
3030
}
3131

3232
@Test

0 commit comments

Comments
 (0)