From 9ee509d33bbb67333c18e2303685dc2efd617241 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 25 Oct 2013 19:58:45 +0200 Subject: [PATCH] Add method to create a profile with a given name. --- .../net/pterodactylus/sone/fcp/AbstractSoneCommandTest.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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; + } + } -- 2.7.4