@Test public void checkGcpLinuxPlatformData() throws Exception { BufferedReader reader; reader = new BufferedReader(new StringReader("HP Z440 Workstation")); assertFalse(CheckGcpEnvironment.checkProductNameOnLinux(reader)); reader = new BufferedReader(new StringReader("Google")); assertTrue(CheckGcpEnvironment.checkProductNameOnLinux(reader)); reader = new BufferedReader(new StringReader("Google Compute Engine")); assertTrue(CheckGcpEnvironment.checkProductNameOnLinux(reader)); reader = new BufferedReader(new StringReader("Google Compute Engine ")); assertTrue(CheckGcpEnvironment.checkProductNameOnLinux(reader)); }
@VisibleForTesting static boolean checkProductNameOnLinux(BufferedReader reader) throws IOException { String name = reader.readLine().trim(); return name.equals("Google") || name.equals("Google Compute Engine"); }
CheckGcpEnvironment { @VisibleForTesting static boolean checkProductNameOnLinux(BufferedReader reader) throws IOException { String name = reader.readLine().trim(); return name.equals("Google") || name.equals("Google Compute Engine"); } }
CheckGcpEnvironment { @VisibleForTesting static boolean checkProductNameOnLinux(BufferedReader reader) throws IOException { String name = reader.readLine().trim(); return name.equals("Google") || name.equals("Google Compute Engine"); } private  CheckGcpEnvironment(); }
CheckGcpEnvironment { @VisibleForTesting static boolean checkProductNameOnLinux(BufferedReader reader) throws IOException { String name = reader.readLine().trim(); return name.equals("Google") || name.equals("Google Compute Engine"); } private  CheckGcpEnvironment();  }
CheckGcpEnvironment { @VisibleForTesting static boolean checkProductNameOnLinux(BufferedReader reader) throws IOException { String name = reader.readLine().trim(); return name.equals("Google") || name.equals("Google Compute Engine"); } private  CheckGcpEnvironment();   }