From: David ‘Bombe’ Roden Date: Fri, 25 Oct 2013 17:58:45 +0000 (+0200) Subject: Add method to create a profile with a given name. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=9ee509d33bbb67333c18e2303685dc2efd617241;p=Sone.git Add method to create a profile with a given name. --- diff --git a/src/test/java/net/pterodactylus/sone/fcp/AbstractSoneCommandTest.java b/src/test/java/net/pterodactylus/sone/fcp/AbstractSoneCommandTest.java index b5de50e..ffa605f 100644 --- a/src/test/java/net/pterodactylus/sone/fcp/AbstractSoneCommandTest.java +++ b/src/test/java/net/pterodactylus/sone/fcp/AbstractSoneCommandTest.java @@ -120,13 +120,16 @@ public class AbstractSoneCommandTest { private Sone prepareSoneToBeEncoded() { long time = (long) (Math.random() * Long.MAX_VALUE); Sone sone = mock(Sone.class); - Profile profile = new Profile(sone); - profile.modify().setFirstName("First").setMiddleName("M.").setLastName("Last").update(); - profile.setField(profile.addField("Test1"), "Value1"); when(sone.getName()).thenReturn("test"); when(sone.getTime()).thenReturn(time); - when(sone.getProfile()).thenReturn(profile); + when(sone.getProfile()).thenReturn(prepareProfile(sone, "First", "M.", "Last")); return sone; } + private Profile prepareProfile(Sone sone, String firstName, String middleName, String lastName) { + Profile profile = new Profile(sone).modify().setFirstName(firstName).setMiddleName(middleName).setLastName(lastName).update(); + profile.setField(profile.addField("Test1"), "Value1"); + return profile; + } + }