From c9ff3d5495b0229d837fa0ec23486cc7b6b191d0 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Fri, 28 Dec 2012 13:13:14 +0100 Subject: o Listing builds on the person view. --- .../io/trygvis/esper/testing/core/db/BuildDao.java | 31 ++++- .../esper/testing/util/sql/PageRequest.java | 4 + .../esper/testing/web/AbstractResource.java | 26 ---- .../io/trygvis/esper/testing/web/CoreResource.java | 132 ------------------- .../trygvis/esper/testing/web/JenkinsResource.java | 86 ------------- .../esper/testing/web/JerseyApplication.java | 78 ++++++++++- .../io/trygvis/esper/testing/web/MagicParam.java | 10 ++ .../testing/web/resource/AbstractResource.java | 26 ++++ .../esper/testing/web/resource/BadgeJson.java | 21 +++ .../esper/testing/web/resource/CoreResource.java | 143 +++++++++++++++++++++ .../testing/web/resource/JenkinsResource.java | 86 +++++++++++++ .../esper/testing/web/resource/PersonJson.java | 17 +++ 12 files changed, 413 insertions(+), 247 deletions(-) delete mode 100644 src/main/java/io/trygvis/esper/testing/web/AbstractResource.java delete mode 100644 src/main/java/io/trygvis/esper/testing/web/CoreResource.java delete mode 100644 src/main/java/io/trygvis/esper/testing/web/JenkinsResource.java create mode 100644 src/main/java/io/trygvis/esper/testing/web/MagicParam.java create mode 100644 src/main/java/io/trygvis/esper/testing/web/resource/AbstractResource.java create mode 100644 src/main/java/io/trygvis/esper/testing/web/resource/BadgeJson.java create mode 100644 src/main/java/io/trygvis/esper/testing/web/resource/CoreResource.java create mode 100644 src/main/java/io/trygvis/esper/testing/web/resource/JenkinsResource.java create mode 100644 src/main/java/io/trygvis/esper/testing/web/resource/PersonJson.java (limited to 'src/main/java/io/trygvis/esper') diff --git a/src/main/java/io/trygvis/esper/testing/core/db/BuildDao.java b/src/main/java/io/trygvis/esper/testing/core/db/BuildDao.java index 24ecfd3..e498017 100644 --- a/src/main/java/io/trygvis/esper/testing/core/db/BuildDao.java +++ b/src/main/java/io/trygvis/esper/testing/core/db/BuildDao.java @@ -7,7 +7,9 @@ import org.joda.time.*; import java.sql.*; import java.util.*; +import static io.trygvis.esper.testing.Util.toList; import static io.trygvis.esper.testing.util.sql.ResultSetF.*; +import static io.trygvis.esper.testing.util.sql.SqlOption.fromRs; import static java.lang.System.*; public class BuildDao { @@ -59,7 +61,34 @@ public class BuildDao { try (PreparedStatement s = c.prepareStatement("SELECT person FROM build_participant WHERE build=?")) { int i = 1; s.setString(i, build.toString()); - return Util.toList(s, getUuid); + return toList(s, getUuid); + } + } + + public SqlOption selectBuild(UUID uuid) throws SQLException { + try (PreparedStatement s = c.prepareStatement("SELECT " + BUILD + " FROM build WHERE uuid=?")) { + int i = 1; + s.setString(i, uuid.toString()); + return fromRs(s.executeQuery()).map(build); + } + } + + public List selectBuildsByPerson(UUID person, PageRequest page) throws SQLException { + try (PreparedStatement s = c.prepareStatement("SELECT " + BUILD + " FROM build b, build_participant bp WHERE bp.person=? AND b.uuid = bp.build ORDER BY created_date LIMIT ? OFFSET ?")) { + int i = 1; + s.setString(i++, person.toString()); + s.setInt(i++, page.count.orSome(10)); + s.setInt(i, page.startIndex.orSome(0)); + return toList(s, build); + } + } + + public List selectBuilds(PageRequest page) throws SQLException { + try (PreparedStatement s = c.prepareStatement("SELECT " + BUILD + " FROM build ORDER BY created_date LIMIT ? OFFSET ?")) { + int i = 1; + s.setInt(i++, page.count.orSome(10)); + s.setInt(i, page.startIndex.orSome(0)); + return toList(s, build); } } } diff --git a/src/main/java/io/trygvis/esper/testing/util/sql/PageRequest.java b/src/main/java/io/trygvis/esper/testing/util/sql/PageRequest.java index 91a00f8..824291c 100644 --- a/src/main/java/io/trygvis/esper/testing/util/sql/PageRequest.java +++ b/src/main/java/io/trygvis/esper/testing/util/sql/PageRequest.java @@ -15,6 +15,10 @@ public class PageRequest { this.count = count; } + public String toString() { + return "PageRequest{startIndex=" + startIndex + ", count=" + count + '}'; + } + public static PageRequest pageReq(HttpServletRequest req) { return new PageRequest( fromNull(req.getParameter("startIndex")).bind(Util.parseInt), diff --git a/src/main/java/io/trygvis/esper/testing/web/AbstractResource.java b/src/main/java/io/trygvis/esper/testing/web/AbstractResource.java deleted file mode 100644 index c811a2f..0000000 --- a/src/main/java/io/trygvis/esper/testing/web/AbstractResource.java +++ /dev/null @@ -1,26 +0,0 @@ -package io.trygvis.esper.testing.web; - -import fj.data.*; -import io.trygvis.esper.testing.*; - -import javax.ws.rs.*; -import javax.ws.rs.core.*; -import java.sql.*; - -public class AbstractResource { - protected final DatabaseAccess da; - - public AbstractResource(DatabaseAccess da) { - this.da = da; - } - - public T get(DatabaseAccess.DaosCallback> callback) throws SQLException { - Option server = da.inTransaction(callback); - - if(server.isNone()) { - throw new WebApplicationException(Response.Status.NOT_FOUND); - } - - return server.some(); - } -} diff --git a/src/main/java/io/trygvis/esper/testing/web/CoreResource.java b/src/main/java/io/trygvis/esper/testing/web/CoreResource.java deleted file mode 100644 index f2fb12a..0000000 --- a/src/main/java/io/trygvis/esper/testing/web/CoreResource.java +++ /dev/null @@ -1,132 +0,0 @@ -package io.trygvis.esper.testing.web; - -import fj.data.*; -import io.trygvis.esper.testing.*; -import io.trygvis.esper.testing.core.badge.*; -import io.trygvis.esper.testing.core.db.*; -import io.trygvis.esper.testing.util.sql.*; - -import javax.servlet.http.*; -import javax.ws.rs.*; -import javax.ws.rs.core.*; -import java.sql.*; -import java.util.*; -import java.util.List; - -import static io.trygvis.esper.testing.util.sql.PageRequest.*; -import static io.trygvis.esper.testing.web.JenkinsResource.*; - -@Path("/resource/core") -@Produces(MediaType.APPLICATION_JSON) -public class CoreResource extends AbstractResource { - - private final BadgeService badgeService; - - public CoreResource(DatabaseAccess da, BadgeService badgeService) { - super(da); - this.badgeService = badgeService; - } - - @GET - @Path("/person") - public List getPersons(@Context final HttpServletRequest req) throws Exception { - final PageRequest pageRequest = pageReq(req); - - return da.inTransaction(new DatabaseAccess.DaosCallback>() { - public List run(Daos daos) throws SQLException { - List list = new ArrayList<>(); - for (PersonDto person : daos.personDao.selectPerson(pageRequest)) { - list.add(getPersonJson(daos, person)); - } - return list; - } - }); - } - - /** - * This is wrong, but Angular's $resource is a bit dumb. - */ - @GET - @Path("/person-count") - public int getPersonCount() throws Exception { - return da.inTransaction(new DatabaseAccess.DaosCallback() { - public Integer run(Daos daos) throws SQLException { - return daos.personDao.selectPersonCount(); - } - }); - } - - @GET - @Path("/person/{uuid}") - public PersonJson getPerson(@PathParam("uuid") final String s) throws Exception { - final UUID uuid = parseUuid(s); - - return get(new DatabaseAccess.DaosCallback>() { - public Option run(Daos daos) throws SQLException { - SqlOption o = daos.personDao.selectPerson(uuid); - if (o.isNone()) { - return Option.none(); - } - - return Option.some(getPersonJson(daos, o.get())); - } - }); - } - - private PersonJson getPersonJson(Daos daos, PersonDto person) throws SQLException { - List badges = new ArrayList<>(); - - for (PersonBadgeDto badge : daos.personDao.selectBadges(person.uuid)) { - badges.add(new BadgeJson(badge.type.name(), badge.level, badge.count, 100, 100)); - } - - List badgesInProgress = new ArrayList<>(); - - for (PersonBadgeProgressDto badgeProgressDto : daos.personDao.selectBadgeProgresses(person.uuid)) { - UnbreakableBadgeProgress progress = badgeService.unbreakable(badgeProgressDto); - badgesInProgress.add(new BadgeJson(progress.type.name(), progress.progressingAgainstLevel(), 0, - progress.progression(), progress.goal())); - } - - return new PersonJson( - person.uuid, - person.name, - badges, - badgesInProgress - ); - } - - public static class PersonJson { - public final UUID uuid; - public final String name; - public final List badges; - public final List badgesInProgress; - - public PersonJson(UUID uuid, String name, List badges, List badgesInProgress) { - this.uuid = uuid; - this.name = name; - this.badges = badges; - this.badgesInProgress = badgesInProgress; - } - } - - public static class BadgeJson { - public final String name; - public final int level; - - /** - * Number of times this badge has been received. - */ - public final int count; - public final int progress; - public final int goal; - - public BadgeJson(String name, int level, int count, int progress, int goal) { - this.name = name; - this.level = level; - this.count = count; - this.progress = progress; - this.goal = goal; - } - } -} diff --git a/src/main/java/io/trygvis/esper/testing/web/JenkinsResource.java b/src/main/java/io/trygvis/esper/testing/web/JenkinsResource.java deleted file mode 100644 index bd925b6..0000000 --- a/src/main/java/io/trygvis/esper/testing/web/JenkinsResource.java +++ /dev/null @@ -1,86 +0,0 @@ -package io.trygvis.esper.testing.web; - -import fj.data.*; -import io.trygvis.esper.testing.*; -import io.trygvis.esper.testing.jenkins.*; -import org.joda.time.*; - -import javax.ws.rs.*; -import javax.ws.rs.core.*; -import java.net.*; -import java.sql.*; -import java.util.*; -import java.util.List; - -import static fj.data.Option.*; - -@Path("/resource/jenkins") -public class JenkinsResource extends AbstractResource { - - public JenkinsResource(DatabaseAccess da) { - super(da); - } - - @GET - @Path("/server") - @Produces(MediaType.APPLICATION_JSON) - public List getServers() throws Exception { - return da.inTransaction(new DatabaseAccess.DaosCallback>() { - public List run(Daos daos) throws SQLException { - List list = new ArrayList<>(); - for (JenkinsServerDto server : daos.jenkinsDao.selectServers(false)) { - list.add(getJenkinsServerJson(daos, server)); - } - return list; - } - }); - } - - @GET - @Path("/server/{uuid}") - @Produces(MediaType.APPLICATION_JSON) - public JenkinsServerJson getServer(@PathParam("uuid") String s) throws Exception { - final UUID uuid = parseUuid(s); - - return get(new DatabaseAccess.DaosCallback>() { - public Option run(final Daos daos) throws SQLException { - Option o = daos.jenkinsDao.selectServer(uuid); - - if (o.isNone()) { - return Option.none(); - } - - return some(getJenkinsServerJson(daos, o.some())); - } - }); - } - - private JenkinsServerJson getJenkinsServerJson(Daos daos, JenkinsServerDto server) throws SQLException { - int count = daos.jenkinsDao.selectJobCountForServer(server.uuid); - return new JenkinsServerJson(server.uuid, server.createdDate, server.url, server.enabled, count); - } - - public static UUID parseUuid(String s) { - try { - return UUID.fromString(s); - } catch (IllegalArgumentException e) { - throw new WebApplicationException(Response.Status.BAD_REQUEST); - } - } -} - -class JenkinsServerJson { - public final UUID uuid; - public final DateTime createdDate; - public final URI url; - public final boolean enabled; - public final int jobCount; - - JenkinsServerJson(UUID uuid, DateTime createdDate, URI url, boolean enabled, int jobCount) { - this.uuid = uuid; - this.createdDate = createdDate; - this.url = url; - this.enabled = enabled; - this.jobCount = jobCount; - } -} diff --git a/src/main/java/io/trygvis/esper/testing/web/JerseyApplication.java b/src/main/java/io/trygvis/esper/testing/web/JerseyApplication.java index eded64c..46964a0 100644 --- a/src/main/java/io/trygvis/esper/testing/web/JerseyApplication.java +++ b/src/main/java/io/trygvis/esper/testing/web/JerseyApplication.java @@ -1,11 +1,23 @@ package io.trygvis.esper.testing.web; +import com.sun.jersey.api.core.*; +import com.sun.jersey.core.spi.component.*; +import com.sun.jersey.server.impl.inject.*; +import com.sun.jersey.spi.inject.*; import io.trygvis.esper.testing.*; import io.trygvis.esper.testing.core.badge.*; +import io.trygvis.esper.testing.util.sql.*; +import io.trygvis.esper.testing.web.resource.*; +import javax.ws.rs.*; import javax.ws.rs.core.*; +import javax.ws.rs.ext.*; +import java.lang.reflect.*; import java.util.*; +import static fj.data.Option.*; +import static io.trygvis.esper.testing.Util.parseInt; + public class JerseyApplication extends Application { private final HashSet singletons; @@ -16,12 +28,74 @@ public class JerseyApplication extends Application { BadgeService badgeService = new BadgeService(); singletons = new HashSet(Arrays.asList( - new CoreResource(da, badgeService), - new JenkinsResource(da) + new CoreResource(da, badgeService), + new JenkinsResource(da) )); } + public Set> getClasses() { + return new HashSet<>(Arrays.>asList(ResourceParamInjector.class)); + } + public Set getSingletons() { return singletons; } + + @Provider + public static class ResourceParamInjector implements InjectableProvider { + + private final ResourceContext rc; + + public ResourceParamInjector(@Context ResourceContext rc) { + this.rc = rc; + } + + public ComponentScope getScope() { + return ComponentScope.PerRequest; + } + + public Injectable getInjectable(final ComponentContext ic, final MagicParam a, Type type) { + if (PageRequest.class.equals(type)) { + return new AbstractHttpContextInjectable() { + public Object getValue(HttpContext hc) { + MultivaluedMap queryParameters = hc.getRequest().getQueryParameters(); + + return new PageRequest( + fromNull(queryParameters.getFirst("startIndex")).bind(parseInt), + fromNull(queryParameters.getFirst("count")).bind(parseInt)); + } + }; + } else if (UUID.class.equals(type)) { + + return new AbstractHttpContextInjectable() { + public Object getValue(HttpContext hc) { + + if (a.query().length() > 0) { + return parse(hc.getRequest().getQueryParameters().getFirst(a.query())); + } else { + MultivaluedMap pathParameters = hc.getUriInfo().getPathParameters(); + + for (Map.Entry> entry : pathParameters.entrySet()) { + if ("uuid".equals(entry.getKey())) { + return parse(entry.getValue().get(0)); + } + } + } + + throw new RuntimeException("@MagicParam used with UUID argument with no {uuid} path variable."); + } + + private UUID parse(String s) { + try { + return UUID.fromString(s); + } catch (IllegalArgumentException e) { + throw new WebApplicationException(400); + } + } + }; + } + + return null; + } + } } diff --git a/src/main/java/io/trygvis/esper/testing/web/MagicParam.java b/src/main/java/io/trygvis/esper/testing/web/MagicParam.java new file mode 100644 index 0000000..1eb3bb0 --- /dev/null +++ b/src/main/java/io/trygvis/esper/testing/web/MagicParam.java @@ -0,0 +1,10 @@ +package io.trygvis.esper.testing.web; + +import java.lang.annotation.*; + +@Target({ElementType.PARAMETER}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface MagicParam { + String query() default ""; +} diff --git a/src/main/java/io/trygvis/esper/testing/web/resource/AbstractResource.java b/src/main/java/io/trygvis/esper/testing/web/resource/AbstractResource.java new file mode 100644 index 0000000..cddec2c --- /dev/null +++ b/src/main/java/io/trygvis/esper/testing/web/resource/AbstractResource.java @@ -0,0 +1,26 @@ +package io.trygvis.esper.testing.web.resource; + +import fj.data.*; +import io.trygvis.esper.testing.*; + +import javax.ws.rs.*; +import javax.ws.rs.core.*; +import java.sql.*; + +public class AbstractResource { + protected final DatabaseAccess da; + + public AbstractResource(DatabaseAccess da) { + this.da = da; + } + + public T get(DatabaseAccess.DaosCallback> callback) throws SQLException { + Option server = da.inTransaction(callback); + + if(server.isNone()) { + throw new WebApplicationException(Response.Status.NOT_FOUND); + } + + return server.some(); + } +} diff --git a/src/main/java/io/trygvis/esper/testing/web/resource/BadgeJson.java b/src/main/java/io/trygvis/esper/testing/web/resource/BadgeJson.java new file mode 100644 index 0000000..65f541a --- /dev/null +++ b/src/main/java/io/trygvis/esper/testing/web/resource/BadgeJson.java @@ -0,0 +1,21 @@ +package io.trygvis.esper.testing.web.resource; + +public class BadgeJson { + public final String name; + public final int level; + + /** + * Number of times this badge has been received. + */ + public final int count; + public final int progress; + public final int goal; + + public BadgeJson(String name, int level, int count, int progress, int goal) { + this.name = name; + this.level = level; + this.count = count; + this.progress = progress; + this.goal = goal; + } +} diff --git a/src/main/java/io/trygvis/esper/testing/web/resource/CoreResource.java b/src/main/java/io/trygvis/esper/testing/web/resource/CoreResource.java new file mode 100644 index 0000000..98b32bb --- /dev/null +++ b/src/main/java/io/trygvis/esper/testing/web/resource/CoreResource.java @@ -0,0 +1,143 @@ +package io.trygvis.esper.testing.web.resource; + +import fj.data.*; +import io.trygvis.esper.testing.*; +import io.trygvis.esper.testing.core.badge.*; +import io.trygvis.esper.testing.core.db.*; +import io.trygvis.esper.testing.util.sql.*; +import io.trygvis.esper.testing.web.*; + +import javax.servlet.http.*; +import javax.ws.rs.*; +import javax.ws.rs.core.*; +import java.sql.*; +import java.util.*; +import java.util.List; + +import static io.trygvis.esper.testing.util.sql.PageRequest.*; + +@Path("/resource/core") +@Produces(MediaType.APPLICATION_JSON) +public class CoreResource extends AbstractResource { + + private final BadgeService badgeService; + + public CoreResource(DatabaseAccess da, BadgeService badgeService) { + super(da); + this.badgeService = badgeService; + } + + // ----------------------------------------------------------------------- + // Person + // ----------------------------------------------------------------------- + + @GET + @Path("/person") + public List getPersons(@Context final HttpServletRequest req) throws Exception { + final PageRequest pageRequest = pageReq(req); + + return da.inTransaction(new DatabaseAccess.DaosCallback>() { + public List run(Daos daos) throws SQLException { + List list = new ArrayList<>(); + for (PersonDto person : daos.personDao.selectPerson(pageRequest)) { + list.add(getPersonJson(daos, person)); + } + return list; + } + }); + } + + @GET + @Path("/person/{uuid}") + public PersonJson getPerson(@PathParam("uuid") final String s) throws Exception { + final UUID uuid = JenkinsResource.parseUuid(s); + + return get(new DatabaseAccess.DaosCallback>() { + public Option run(Daos daos) throws SQLException { + SqlOption o = daos.personDao.selectPerson(uuid); + if (o.isNone()) { + return Option.none(); + } + + return Option.some(getPersonJson(daos, o.get())); + } + }); + } + + private PersonJson getPersonJson(Daos daos, PersonDto person) throws SQLException { + List badges = new ArrayList<>(); + + for (PersonBadgeDto badge : daos.personDao.selectBadges(person.uuid)) { + badges.add(new BadgeJson(badge.type.name(), badge.level, badge.count, 100, 100)); + } + + List badgesInProgress = new ArrayList<>(); + + for (PersonBadgeProgressDto badgeProgressDto : daos.personDao.selectBadgeProgresses(person.uuid)) { + UnbreakableBadgeProgress progress = badgeService.unbreakable(badgeProgressDto); + badgesInProgress.add(new BadgeJson(progress.type.name(), progress.progressingAgainstLevel(), 0, + progress.progression(), progress.goal())); + } + + return new PersonJson( + person.uuid, + person.name, + badges, + badgesInProgress + ); + } + + // ----------------------------------------------------------------------- + // Build + // ----------------------------------------------------------------------- + + @GET + @Path("/build") + public List getBuilds(@MagicParam final PageRequest page, @MagicParam(query = "person") final UUID person) throws Exception { + return da.inTransaction(new DatabaseAccess.DaosCallback>() { + public List run(Daos daos) throws SQLException { + List buildDtos; + + if(person != null) { + buildDtos = daos.buildDao.selectBuildsByPerson(person, page); + } + else { + buildDtos = daos.buildDao.selectBuilds(page); + } + + List list = new ArrayList<>(); + for (BuildDto build : buildDtos) { + list.add(getBuildJson(daos, build)); + } + return list; + } + }); + } + + @GET + @Path("/build/{uuid}") + public BuildJson getBuild(@MagicParam final UUID uuid) throws Exception { + return get(new DatabaseAccess.DaosCallback>() { + public Option run(Daos daos) throws SQLException { + SqlOption o = daos.buildDao.selectBuild(uuid); + if (o.isNone()) { + return Option.none(); + } + + return Option.some(getBuildJson(daos, o.get())); + } + }); + } + + private BuildJson getBuildJson(Daos daos, BuildDto build) { + return new BuildJson(build.uuid); + } + + public static class BuildJson { + public final UUID uuid; + + public BuildJson(UUID uuid) { + this.uuid = uuid; + } + } +} diff --git a/src/main/java/io/trygvis/esper/testing/web/resource/JenkinsResource.java b/src/main/java/io/trygvis/esper/testing/web/resource/JenkinsResource.java new file mode 100644 index 0000000..284d90e --- /dev/null +++ b/src/main/java/io/trygvis/esper/testing/web/resource/JenkinsResource.java @@ -0,0 +1,86 @@ +package io.trygvis.esper.testing.web.resource; + +import fj.data.*; +import io.trygvis.esper.testing.*; +import io.trygvis.esper.testing.jenkins.*; +import org.joda.time.*; + +import javax.ws.rs.*; +import javax.ws.rs.core.*; +import java.net.*; +import java.sql.*; +import java.util.*; +import java.util.List; + +import static fj.data.Option.*; + +@Path("/resource/jenkins") +public class JenkinsResource extends AbstractResource { + + public JenkinsResource(DatabaseAccess da) { + super(da); + } + + @GET + @Path("/server") + @Produces(MediaType.APPLICATION_JSON) + public List getServers() throws Exception { + return da.inTransaction(new DatabaseAccess.DaosCallback>() { + public List run(Daos daos) throws SQLException { + List list = new ArrayList<>(); + for (JenkinsServerDto server : daos.jenkinsDao.selectServers(false)) { + list.add(getJenkinsServerJson(daos, server)); + } + return list; + } + }); + } + + @GET + @Path("/server/{uuid}") + @Produces(MediaType.APPLICATION_JSON) + public JenkinsServerJson getServer(@PathParam("uuid") String s) throws Exception { + final UUID uuid = parseUuid(s); + + return get(new DatabaseAccess.DaosCallback>() { + public Option run(final Daos daos) throws SQLException { + Option o = daos.jenkinsDao.selectServer(uuid); + + if (o.isNone()) { + return Option.none(); + } + + return some(getJenkinsServerJson(daos, o.some())); + } + }); + } + + private JenkinsServerJson getJenkinsServerJson(Daos daos, JenkinsServerDto server) throws SQLException { + int count = daos.jenkinsDao.selectJobCountForServer(server.uuid); + return new JenkinsServerJson(server.uuid, server.createdDate, server.url, server.enabled, count); + } + + public static UUID parseUuid(String s) { + try { + return UUID.fromString(s); + } catch (IllegalArgumentException e) { + throw new WebApplicationException(Response.Status.BAD_REQUEST); + } + } +} + +class JenkinsServerJson { + public final UUID uuid; + public final DateTime createdDate; + public final URI url; + public final boolean enabled; + public final int jobCount; + + JenkinsServerJson(UUID uuid, DateTime createdDate, URI url, boolean enabled, int jobCount) { + this.uuid = uuid; + this.createdDate = createdDate; + this.url = url; + this.enabled = enabled; + this.jobCount = jobCount; + } +} diff --git a/src/main/java/io/trygvis/esper/testing/web/resource/PersonJson.java b/src/main/java/io/trygvis/esper/testing/web/resource/PersonJson.java new file mode 100644 index 0000000..e8008e3 --- /dev/null +++ b/src/main/java/io/trygvis/esper/testing/web/resource/PersonJson.java @@ -0,0 +1,17 @@ +package io.trygvis.esper.testing.web.resource; + +import java.util.*; + +public class PersonJson { + public final UUID uuid; + public final String name; + public final List badges; + public final List badgesInProgress; + + public PersonJson(UUID uuid, String name, List badges, List badgesInProgress) { + this.uuid = uuid; + this.name = name; + this.badges = badges; + this.badgesInProgress = badgesInProgress; + } +} -- cgit v1.2.3