LP 1780660: Add more workstation functions to OpenILS::Utils::TestUtils.
[Evergreen.git] / Open-ILS / src / perlmods / live_t / 18-lp1592891_sip_standing_penalties.t
index bf695bc..ca8754e 100644 (file)
@@ -18,21 +18,6 @@ our $apputils = 'OpenILS::Application::AppUtils';
 use constant WORKSTATION_NAME => 'BR1-test-lp1592891_sip_standing_penalties.t';
 use constant WORKSTATION_LIB => 4;
 
-# Because this may run multiple times, without a DB reload, we search
-# for the workstation before registering it.
-sub find_workstation {
-    my $r = $apputils->simplereq(
-        'open-ils.actor',
-        'open-ils.actor.workstation.list',
-        $script->authtoken,
-        WORKSTATION_LIB
-    );
-    if ($r->{&WORKSTATION_LIB}) {
-        return scalar(grep {$_->name() eq WORKSTATION_NAME} @{$r->{&WORKSTATION_LIB}});
-    }
-    return 0;
-}
-
 sub retrieve_penalty {
     my $e = shift;
     my $penalty = shift;
@@ -124,7 +109,7 @@ $script->authenticate({
 ok($script->authtoken, 'Initial Login');
 
 SKIP: {
-    my $ws = find_workstation();
+    my $ws = $script->find_workstation(WORKSTATION_NAME, WORKSTATION_LIB);
     skip 'Workstation exists', 1 if ($ws);
     $ws = $script->register_workstation(WORKSTATION_NAME, WORKSTATION_LIB) unless ($ws);
     ok(! ref $ws, 'Registered a new workstation');