ServerCap { public String getWitsmlObject(String version) throws JAXBException, UnsupportedOperationException { if (!"1.3.1.1".equals(version) && !"1.4.1.1".equals(version)){ throw new UnsupportedOperationException("Version not supported by the capabilites object"); } if ("1.3.1.1".equals(version)){ return get1311Object(); } else { return get1411Object(); } } ServerCap(); void addGrowingTimeoutPeriod(String objectName, int timeout); void removeGrowingTimeoutPeriod(String objectName); String getContactName(); void setContactName(String contactName); String getContactEmail(); void setContactEmail(String contactEmail); String getContactPhone(); void setContactPhone(String contactPhone); String getDescription(); void setDescription(String description); String getVendor(); void setVendor(String vendor); int getChangeDetectionPeriod(); void setChangeDetectionPeriod(int changeDetectionPeriod); boolean isCascadedDelete(); void setCascadedDelete(boolean cascadedDelete); boolean isSupportUomConversion(); void setSupportUomConversion(boolean supportUomConversion); String getCompressionMethod(); void setCompressionMethod(String compressionMethod); String getServerName(); void setServerName(String serverName); void addFunction(String functionName, List<DataObject> objects); void removeFunction(String functionName); String getWitsmlObject(String version);  }
@Test public void generateDefault1311Object() throws JAXBException { ServerCap sc = new ServerCap(); String obj = sc.getWitsmlObject("1.3.1.1"); assertNotNull(obj); assertNotEquals(obj, ""); assertThat(obj, containsString("1.3.1.1")); }
@Test public void generateDefault1411Object() throws JAXBException { ServerCap sc = new ServerCap(); String obj = sc.getWitsmlObject("1.4.1.1"); assertNotNull(obj); assertNotEquals(obj, ""); assertThat(obj, containsString("1.4.1.1")); }